|
Baitiah; First, for manually creating your sequence,
autocomplete is quite valuable. Type the first couple of
characters then <ctl>-space. You get a list of completions
to choose from. It's a bit time saver mostly because it reduces
typos to zero. To create the sequence programatically, you can utilize the rdf:Seq syntax in a SPARQL query. For example a SPARQL syntax for three items in a :has Students sequence is: ?someRsc :hasStudent _:b0 . _:b0 a rdf:Seq . _:b0 rdf:_1 :s001 . _:b0 rdf:_2 :s002 . _:b0 rdf:_3 :s003 . The remaining detail is to create a sequence of integers for the ordering. This can be done with a SPARQLMotion script. and I have attached an example. The script uses IterateOverSelect to generate a sequence number each member of a class, ordered through ORDER BY (of course any criteria can be used to query out the sequence members). The script is in the .sms file and the data it imports is in the other file. If you run the script a new file is created with an alphanumerically ordered rdf:seq list. -- Scott On 3/25/11 2:57 AM, Baitiah Ambiah wrote: --Thanks Hoger for the prompt reply. The syntax [A, B, C] .. Is this sequence is define by ourself?for example , i hv property called hasStudent and this property is rdf:Seq. If i have a class which has 100 hundred students.. If i want to link hasStudent to the students and in alphabetic order , do i need to do it manually , and put in this, for example [ Amy, Johann, Mohamed,..etc] ? Is there a way to automatically arrange the order by using rdf:Seq? or it just a place that topbraid offer , intentionally to put ordered list? Thanks alot . On Mar 25, 1:50 pm, Holger Knublauch <[email protected]> wrote:Hi Baitiah, since there is an infinite number of rdf:_1, rdf:_2 etc properties, we cannot enumerate them in advance. If you really want to drill down onto that level, you would need to define them yourself. However, TBC makes editing rdf:Seqs easy. If the range of your property is rdf:Seq, then it will automatically use a Seq editor. The syntax there is [A, B, C] Regards. Holger On Mar 25, 2011, at 12:06 PM, Baitiah Ambiah wrote:Hi All, I have couple of questions about rdfs:Container which are rdf:bag ,rdf:Seq and rdf:Alt.From my understanding, bag is intended for unordered set , Seq is for ordered set and Alt is for alternative set.I qoute the below statement about rdf:Bag ( fromhttp://www.w3.org/TR/rdf-syntax/)"The members of the container can be described by defining a container membership property for each member with the container resource as its subject and the member as its object. These container membership properties have names of the form rdf:_n, where n is a decimal integer greater than zero, with no leading zeros, e.g., rdf:_1, rdf:_2, rdf:_3, and so on, and are used specifically for describing the members of containers."My question ; is these rdf:_1 , rdf:_2 and so on need to be defined by ourself and put under type : rdfs:ContainerMembershipProperty?Another question is , for rdf:Seq , is the order need to be defined by ourself?Thanks in advance..-- You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion 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- Hide quoted text -- Show quoted text - You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include TopBraid Composer, TopBraid Live, TopBraid Ensemble, SPARQLMotion 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 |
# Saved by TopBraid on Fri Mar 25 11:43:17 CDT 2011 # baseURI: http://support.tq.com/rdfSeqExample # imports: http://topbraid.org/sparqlmotionfunctions # imports: http://topbraid.org/sparqlmotionlib @prefix ex: <http://support.tq.com/rdfSeqExampledata#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfSeqExample: <http://support.tq.com/rdfSeqExample#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix sm: <http://topbraid.org/sparqlmotion#> . @prefix smf: <http://topbraid.org/sparqlmotionfunctions#> . @prefix sml: <http://topbraid.org/sparqlmotionlib#> . @prefix sp: <http://spinrdf.org/sp#> . @prefix spin: <http://spinrdf.org/spin#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://support.tq.com/rdfSeqExample> rdf:type owl:Ontology ; owl:imports <http://topbraid.org/sparqlmotionfunctions> , <http://topbraid.org/sparqlmotionlib> ; owl:versionInfo "Created with TopBraid Composer"^^xsd:string . rdfSeqExample:CreateSeqProp rdf:type sml:ApplyConstruct ; rdfs:label "Create seq prop"^^xsd:string ; sml:constructQuery [ rdf:type sp:Construct ; sp:templates ([ sp:object [ sp:varName "inst"^^xsd:string ] ; sp:predicate _:b1 ; sp:subject _:b2 ]) ; sp:where ([ rdf:type sp:Let ; sp:expression [ rdf:type sp:add ; sp:arg1 [ sp:varName "i"^^xsd:string ] ; sp:arg2 1 ] ; sp:variable [ sp:varName "index"^^xsd:string ] ] [ sp:object _:b2 ; sp:predicate ex:hasStudent ; sp:subject ex:Course_1 ] [ rdf:type sp:Let ; sp:expression [ rdf:type smf:buildURI ; sp:arg1 "rdf:_{?index}" ] ; sp:variable _:b1 ]) ] . rdfSeqExample:ExportToRDFFile_1 rdf:type sml:ExportToRDFFile ; rdfs:label "Export to RDFFile 1"^^xsd:string ; sm:nodeX 468 ; sm:nodeY 411 ; sml:baseURI "http://support.tq.com/rdfSeqExampledata_new"^^xsd:string ; sml:targetFilePath "rdfSeqExample-new.ttl"^^xsd:string . <http://support.tq.com/rdfSeqExample#Import-rdfSeqExample.ttl_1> rdf:type sml:ImportRDFFromWorkspace ; rdfs:label "Import rdfSeqExample.ttl"^^xsd:string ; sm:next rdfSeqExample:createSeqBnode ; sm:nodeX 284 ; sm:nodeY 71 ; sml:baseURI "http://support.tq.com/rdfSeqExampledata"^^xsd:string . rdfSeqExample:IterateOverSelect_1 rdf:type sml:IterateOverSelect ; rdfs:label "Iterate over select 1"^^xsd:string ; sm:body rdfSeqExample:CreateSeqProp ; sm:next rdfSeqExample:ExportToRDFFile_1 ; sm:nodeX 286 ; sm:nodeY 270 ; sml:iterationVariable "i"^^xsd:string ; sml:selectQuery [ rdf:type sp:Select ; sp:orderBy (_:b3) ; sp:where ([ sp:object ex:Student ; sp:predicate rdf:type ; sp:subject _:b3 ]) ] . rdfSeqExample:createSeqBnode rdf:type sml:ApplyConstruct ; rdfs:label "create seq bnode"^^xsd:string ; sm:next rdfSeqExample:IterateOverSelect_1 ; sml:constructQuery [ rdf:type sp:Construct ; sp:templates ([ sp:object _:b4 ; sp:predicate ex:hasStudent ; sp:subject ex:Course_1 ] [ sp:object rdf:Seq ; sp:predicate rdf:type ; sp:subject _:b4 ]) ; sp:where () ] . _:b1 sp:varName "prop"^^xsd:string . _:b2 sp:varName "seqnode"^^xsd:string . _:b3 sp:varName "inst"^^xsd:string .
# Saved by TopBraid on Fri Mar 25 11:37:23 CDT 2011 # baseURI: http://support.tq.com/rdfSeqExampledata @prefix ex: <http://support.tq.com/rdfSeqExampledata#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://support.tq.com/rdfSeqExampledata> rdf:type owl:Ontology ; owl:versionInfo "Created with TopBraid Composer"^^xsd:string . ex:Course rdf:type owl:Class ; rdfs:label "Course"^^xsd:string ; rdfs:subClassOf owl:Thing . ex:Course_1 rdf:type ex:Course ; rdfs:label "Course 1"^^xsd:string . ex:Student rdf:type owl:Class ; rdfs:label "Student"^^xsd:string ; rdfs:subClassOf owl:Thing . ex:hasStudent rdf:type owl:ObjectProperty ; rdfs:label "has student"^^xsd:string ; rdfs:range rdf:Seq . ex:s001 rdf:type ex:Student ; rdfs:label "s001"^^xsd:string . ex:s002 rdf:type ex:Student ; rdfs:label "s002"^^xsd:string . ex:s003 rdf:type ex:Student ; rdfs:label "s003"^^xsd:string . ex:s101 rdf:type ex:Student ; rdfs:label "s101"^^xsd:string . ex:s205 rdf:type ex:Student ; rdfs:label "s205"^^xsd:string . ex:s333 rdf:type ex:Student ; rdfs:label "s333"^^xsd:string .
