Question

I am using a tool called TopQuadrant to create a Semantic Web (RDF/OWL) Ontology. This tool allows for import of data from MS Excel. My spreadsheet is basically a two-column sheet with the first column being an XPATH expression and the second column being a description of that XPATH.

Once I import my spreadsheet, I would like to use SPARQL to iterate through the data to create an Ontology based on the values in my first column. For instance, if I had a sheet that looked as follows:

XPATH                              Description
Food
Food/Fruit
Food/Fruit/Apple
Food/Vegetables
Food/Vegetables/Turnips

I would like SPARQL to create my Ontology with a root class (under "Thing" of course) of 'Food', and under 'Food', 2 subclasses called 'Fruit' and 'Vegetables', and under 'Fruit' a subclass of 'Apple', and under 'Vegetables' a sublcass of Turnips... going on down the line.

Is this something that SPARQL can do?

Thanks in advance.

Was it helpful?

Solution

No I don't think it is, SPARQL is designed as a query language so this is beyond it's scope. While you have implied from the question title you wish to use a CONSTRUCT query to do this it's not something that is doable under SPARQL 1.0 because of the format of your data.

Your question requires processing of the values in your first column in a way that's not possible with SPARQL without defining your own custom extensions to it - I am unsure if TopQuadrant has any kind of support for this.

Based on the data in your spreadsheet alone this is not possible, BUT it may be possible depending on how TopQuadrant imports your spreadsheet. As a Semantic Web tool I would assume that TopQuadrant is converting your spreadsheet input into some kind of RDF. If this is the case and you can edit your question to add that RDF representation I could give you a more definitive answer.

I would expect that even in an RDF form you probably can't achieve your aim with a single query

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top