|
Tony; Attached please find an example script that
adds a new prefix and modifies another prefix by removing the old
prefix and adding a new one. Hard to say what is happening in your script, but I'd guess that your prefix definitions don't exactly match your URIs. One way to address this is to open your file in Composer, open a resource with the full URI in it, and use Assign Prefix to Namespace... (context triangle in upper-left of Form) to assign a prefix. -- Scott On 3/26/12 9:28 AM, abcoates wrote: -- 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 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 |
# baseURI: http://support.tq.com/ModifyPrefixExample # imports: http://topbraid.org/sparqlmotionfunctions # imports: http://topbraid.org/sparqlmotionlib-tbc
@prefix ex: <http://support.tq.com/ModifyPrefixExample#> . @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . @prefix kennedys: <http://topbraid.org/examples/kennedys#> . @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 rel: <http://myexample.org/relations#> . @prefix sm: <http://topbraid.org/sparqlmotion#> . @prefix sml: <http://topbraid.org/sparqlmotionlib#> . @prefix sp: <http://spinrdf.org/sp#> . @prefix spif: <http://spinrdf.org/spif#> . @prefix spin: <http://spinrdf.org/spin#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://support.tq.com/ModifyPrefixExample> rdf:type owl:Ontology ; owl:imports <http://topbraid.org/sparqlmotionlib-tbc> , <http://topbraid.org/sparqlmotionfunctions> ; owl:versionInfo "Created with TopBraid Composer"^^xsd:string . ex:AddRelationPrefix rdf:type sml:ModifyPrefixes ; rdfs:label "Add relation prefix"^^xsd:string ; sm:next ex:CreateUncles ; sml:addedPrefix "rel http://myexample.org/relations#"^^xsd:string . ex:ChangeKennedyPrefix rdf:type sml:ModifyPrefixes ; rdfs:label "Change kennedy prefix"^^xsd:string ; sm:next ex:Kennedy_Return ; sm:nodeX 207 ; sm:nodeY 287 ; sml:addedPrefix "xyz http://topbraid.org/examples/kennedys#"^^xsd:string ; sml:deletedPrefix "kennedys http://topbraid.org/examples/kennedys#"^^xsd:string . ex:CreateKennedyRelations rdf:type sm:Function ; rdfs:subClassOf sm:Functions ; sm:returnModule ex:Kennedy_Return . ex:CreateUncles rdf:type sml:ApplyConstruct ; rdfs:label "Create uncles"^^xsd:string ; sm:next ex:ChangeKennedyPrefix ; sm:nodeX 306 ; sm:nodeY 179 ; sml:constructQuery [ rdf:type sp:Construct ; sp:templates ([ sp:object [ sp:varName "uncle"^^xsd:string ] ; sp:predicate [ sp:varName "unclePred"^^xsd:string ] ; sp:subject [ sp:varName "person"^^xsd:string ] ]) ; sp:where ([ sp:object [ sp:varName "parent"^^xsd:string ] ; sp:predicate kennedys:parent ; sp:subject [ sp:varName "person"^^xsd:string ] ] [ rdf:type sp:TriplePath ; sp:object [ sp:varName "uncle"^^xsd:string ] ; sp:path [ rdf:type sp:SeqPath ; sp:path1 kennedys:parent ; sp:path2 kennedys:child ] ; sp:subject [ sp:varName "parent"^^xsd:string ] ] [ sp:object kennedys:male ; sp:predicate kennedys:gender ; sp:subject [ sp:varName "uncle"^^xsd:string ] ] [ rdf:type sp:Filter ; sp:expression [ rdf:type sp:ne ; sp:arg1 [ sp:varName "uncle"^^xsd:string ] ; sp:arg2 [ sp:varName "parent"^^xsd:string ] ] ] [ rdf:type sp:Bind ; sp:expression [ rdf:type spif:buildURI ; sp:arg1 "rel:uncle" ] ; sp:variable [ sp:varName "unclePred"^^xsd:string ] ]) ] . <http://support.tq.com/ModifyPrefixExample#Import-kennedys.ttl_1> rdf:type sml:ImportRDFFromWorkspace ; rdfs:label "Import kennedys.ttl"^^xsd:string ; sm:next ex:CreateUncles ; sm:nodeX 165 ; sm:nodeY 20 ; sml:baseURI "http://topbraid.org/examples/kennedys"^^xsd:string . ex:Kennedy_Return rdf:type sml:ReturnRDF ; sm:nodeX 406 ; sm:nodeY 369 ; sml:serialization sml:Turtle .
