Constructing Complex Results with SPARQL
2009/10/03 Leave a comment
A quick side note:
At several points, I have compared SQL to the W3C language stack and one of the capabilities in SQL that was awkward in the OWL/SWRL combination was the lack of a way to construct complex results (such as blank nodes and new sub-graphs) in the way that SQL can do with its data manipulation language. Ideally, we want to be able to do all with the new stack that the older relational languages could do and without needing to leave the session (all in the same script).
As I was reviewing SPARQL, the W3C query language, I came across the CONSTRUCT query type. This allows a query to create a new graph (group of triples) constructed from the data in the triples. I am starting to look at this as a possible way to get around the issue. It appears that if OWL/SWRL takes care of making the logical inferences, the facts can then be gathered and re-formed into a new “shape” using SPARQL CONSTRUCT queries. The problem is that while OWL/SWRL live in the session, SPARQL really lives outside, in the sense that the SPARQL query is initiated externally to pull information from the knowledge base or working memory. If this knowledge was needed in the session, it would need to be pulled, then reinserted by some external process.
Since the topic right now needs to do work with existing ontologies, new object construction will be an issue. I need to be able to take data in one OWL schema and construct equivalent objects in types of a new ontology. One project that will probably come up is converting existing data to an upper ontology (such as SUMO) and this is sure to come up.
As with any part of the stack, having it work on a given platform is always in question. It will need to be tested. To do the project above, I am creating some convenience modules in JAVA to let me construct an ETL process for OWL data (much like the loader components I would use with a SQL database or XML with ESB components).
Back to Ontology again.