TopBraid's Import Spreadsheets feature assumes that rows are instances of a
class with columns representing properties. A more flexible alternative is
importing a spreadsheet into the spreadsheet ontology, which lets you
address cells individually in a SPARQL query and convert them to conform to
whatever model you like.
This feature works with .xls spreadsheets, so you'd have to convert your
data to that first. After doing so, pick Import from the File menu and then
pick Import Excel File into Spreadsheet Ontology. After you identify the
file to import and finish up, you'll have an RDF file where the data is
modeled using the ss:Cell, ss:Sheet, and ss:Workbook classes of the
spreadsheet ontology. After doing this with your data, a transformation
query similar to the following should convert its values to the class
declarations that you describe:
CONSTRUCT {
?newClass a rdfs:Class .
?newClass rdfs:subClassOf ?superClass .
}
WHERE {
?c a ss:Cell .
?c ss:row ?row .
?c ss:column ?col .
?c ss:cellContents ?contents .
FILTER (?row > 0) .
BIND ((?col - 1) AS ?parentCol) .
OPTIONAL {
?parent ss:row ?row .
?parent ss:column ?parentCol .
?parent ss:cellContents ?parentContents .
} .
BIND (IRI(fn:concat("http://example.org/", ?contents)) AS ?newClass) .
BIND (IRI(fn:concat("http://example.org/", ?parentContents)) AS
?superClass) .
}
Bob DuCharme
TopQuadrant
On Tue, Jul 17, 2012 at 1:11 PM, OntoLearner <[email protected]> wrote:
> Hello everyone,
>
> I have a spreadsheet with 5 columns, which needs to be converted into OWL.
> The columns contain sub-category (sub-class), and I am trying to convert
> the spreadsheet in a way that allows for the lowest level element to be
> related to the subclass above it in the hierarchy, and the so that there is
> some kind of cascading effect. The columns are: A, B, C, D, E, and F, so
> the result should be as follows: E->D->C-B->A. With A being the highest
> class in the chain. By making F a subclass of E, I am hoping to have a
> cascading effect, whereby E will be automatically related to D, C, B, and A.
>
> Here is an example of my spreadsheet:
>
> column1 column2 column3 column3 column4 SuperClass 1 SubClass 1-1
> SuperClass 2 SubClass 1-2 SubClass 2-1
> SuperClass 3 SubClass 1-3 SubClass 2-2
> SuperClass 4 SubClass 1-4 SubClass 2-3
> SuperClass 5 SubClass 1-5 SubClass 2-4
> SuperClass 6 SubClass 1-6 SubClass 2-5
> SuperClass 7 SubClass 1-7 SubClass 2-6 SubClass 3-1 SubClass 4-1
> SuperClass 8 SubClass 1-8 SubClass 2-7 SubClass 3-2 SubClass 4-2
>
> So column4 is a subclass to column3, column3 subclass to column2, and
> column2 subclass to column1, which is my superclass.
>
> Hopefully this makes sense to you.
>
> PS: I have also attached sample data for easy reference.
>
> --
> -- You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include Enterprise
> Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
> TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
>
>
>
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en