Funble-fingers errantly hit a key.  The last part of the query is:

SELECT *
WHERE
{ ?s :category1 ?c1 .
  ?s :category2 ?c2 .
  ?s :catefory3 ?c3 .
  OPTIONAL { ?s skos:definition ?def }
  OPTIONAL { ?s skos:altLabel ?label }
}

-- Scott

On Oct 29, 2:49 pm, Scott Henninger <[email protected]>
wrote:
> OntoLearner;  I wasn't clear on how you were getting the spreadsheet
> into triples.  Here are two possibilities:
>
> 1. Tab-delimited file
>
> In this case, I'd suggest using tab-delimited import (see Help > >
> Importing Data Sources > Import external information > Import
> Spreadsheets
> Import Tab-Separated Spreadsheets, part 2 "Importing the spreadsheet
> to the currently selected ontology".
>
> This would require adding a first column that named the class you
> import into (row 0, column 0) and each instance (name them anything,
> you can always re-name them via SPARQL transforms later.  An outline
> of the process:
>   a. Create a file and import SKOS
>   b. Create a class definition that corresponds to row 0, column 0
>   c. Right-click the file in the Navigator and choose Import >
> TopBraid Composer > Import Tab-Delimited Spreadsheet File
>   d. In first page of wizard, be sure to choose "Import to the current
> ontology"
>   e. In last page of wizard, you can change the types (Property Range)
> to skos:altLabel, skos:definition, etc
>
> 2. Excel (.xls) import
>
> In this case, open the file in Excel and save as a .xls file.  Place
> in Composer's navigator (copy/paste or drag/drop) and open this
> directly in Composer - open with... > TopBraid (Excel Documents)
>
> The effect will be similar to 1., except that the instances and class
> will be named in order.  Again, you can use a SPARQL transformation to
> rename as needed.
>
> 3.  EVN Spreadsheet import
>
> In this case the spreadsheet you outline can be converted into a
> hierarchy with the spreadsheet importer.  See the Column-Based Tree 
> athttp://topquadrant.com/topbraid/evn/362doc/userguide.html#importing-s...
>
> There was a question about how to make something optional in a query.
> Again, I don't know exactly how your data shows in triples, but the
> SPARQL would look something like:
>
> SELECT *
> WHERE
> { ?s :category1 ?c1 .
>   ?s :category2 ?c2 .
>   ?s :catefory3 ?c3 .
>   OPTIONAL { ?s skos:definition }
>   OPTIONAL
>
> On Oct 29, 1:38 pm, OntoLearner <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I am trying to convert the below spreadsheet using SPARQL.
>
> > I would like to create a taxonomy, which has top 3, 4, or 5 categories with
> > the term as the lowest being element. The term can have a synonym and/or
> > acronym, and a definition.
>
> > Because the synonym, acronym, and definition may exist or not, I want to
> > make them optional in my query.
>
> > Hopefully someone can help with the above.
>
> > I am able to import the spreadsheet into spreadsheet ontology inside TBCME,
> > but I am struggling to create the categories together with the terms and
> > its synonym, acronym or definition.
>
> >    Category 1 Category 2 Category 3 Term Term synonym (skos:altLabel) Term
> > Acronym(termAcronym) Term Definition (skos:definition)  Test 1 Test 2 Test 3
> > Term1 Acronym 1  Test 1 Test 2 Test 3 Term2 Synonym 2 Acronym 2 Sample
> > definition  Test 1 Test 2 Test 3 Term3 Synonym 3   Test 1 Test 2 Test 3
> > Term4 Synonym 4 Acronym 4 Sample definition  Test 1 Test 2 Test 3 Term5 
> > Synonym
> > 5 Acronym 5  Test 1 Test 2 Test 3 Term6 Synonym 6   Test 1 Test 2 Test 3
> > Term7 Synonym 7 Acronym 7  Test 1 Test 2 Test 3 Term8 Acronym 8  Test 1 Test
> > 2 Test 3 Term9 Synonym 9 Acronym 9  Test 1 Test 2 Test 3 Term10 Synonym 10 
> > Acronym
> > 10  Test 1 Test 2 Test 3 Term11 Acronym 11
>
> > Thank you for your help.

-- 
-- 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


Reply via email to