Jürgen Jakobitsch wrote:
hi,
i'm really having troubles figuring out how to get my option transitive right
for the following :
- i have a couple of skos:concepts in a skos:narrower hierarchy.
- i have an inference graph that apparently works.
- i have read the doc (16.2.12) but can't get my sparql query to work properly
(i get all sorts of results but not the one i want).
i'd like to list ?p and ?o of the topmost skos:concept of that hierarchy and
expect all sub-elements
(the whole skos:narrower - chain) to show up in the result with
skos:narrowerTransitive as ?p.
example :
1. import (file also in attachment)
<rdf:Description rdf:about="http://www.turnguard.com/Music">
<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
<skos:prefLabel xml:lang="en">Music</skos:prefLabel>
<skos:narrower rdf:resource="http://www.turnguard.com/Pop" />
</rdf:Description>
<rdf:Description rdf:about="http://www.turnguard.com/Pop">
<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
<skos:prefLabel xml:lang="en">POP</skos:prefLabel>
<skos:narrower rdf:resource="http://www.turnguard.com/TechnoPop" />
</rdf:Description>
<rdf:Description rdf:about="http://www.turnguard.com/TechnoPop">
<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
<skos:prefLabel xml:lang="en">TECHNOPOP</skos:prefLabel>
<skos:narrower rdf:resource="http://www.turnguard.com/ElectroPop" />
</rdf:Description>
<rdf:Description rdf:about="http://www.turnguard.com/ElectroPop">
<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
<skos:prefLabel xml:lang="en">ELECTROPOP</skos:prefLabel>
</rdf:Description>
2. SPARQL : define input:inference "skosruleset" SELECT * FROM <urn:mygraph>
WHERE { ?s ?p ?o } includes statements that
about skos:semanticRelation (is a superprop of skos:narrower) rdfs:labels
(because of skos:prefLabel)
and skos:narrowerTransitive (is a superprop of skos:narrower)
- the proplem is that there's allways only ONE skos:narrowerTransitive for
each narrower (they go parallel)
which is not surprising due to the absence of any option transitive - but
just to make sure basic inferencing works.
now how can i transform my sparql-query to get the following result (short
forms of the uris):
Music skos:prefLabel "Music"
Music rdf:type skos:Concept
Music skos:narrower Pop
Music skos:narrowerTransitive Pop
Music skos:narrowerTransitive TechnoPop
Music skos:narrowerTransitive ElectroPop
any help or pointer to the right direction really appreciated
wkr www.turnguard.com
------------------------------------------------------------------------
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
------------------------------------------------------------------------
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users
Did you digest:
http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsparqlimplementatiotransexamples7
Re. scoping the transitive closure to segments of hierarchy use:
OPTION ( TRANSITIVE, t_distinct, t_in (?hierarchy_top), t_out
(<hierarchy_bottom) ) .
If this doesn't work just send you sample SPARQL example.
--
Regards,
Kingsley Idehen
President & CEO
OpenLink Software
Web: http://www.openlinksw.com
Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter: kidehen