If you are using reasoning, the wildcard in the predicate does capture rdf:type in the result set.
For example, I have the following data
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dbp: <http://dbpedia.org/data/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix : <http://matonto.org/data/2014/04/inovex/> .
:spreadsheet1 dct:format dbp:Comma-separated_values .
dct:format rdfs:range dct:MediaTypeOrExtent ;
Query
select ?s ?o where {
?s dct:format ?o .
?o ?p <http://purl.org/dc/terms/MediaTypeOrExtent> .
}
The result set is empty.
However, the following query captures the inferred rdf:type in the result set
Query
select ?s ?o where {
?s dct:format ?o .
?o a <http://purl.org/dc/terms/MediaTypeOrExtent> .
}
Result Set
s | o
http://matonto.org/data/2014/04/inovex/spreadsheet1 | http://dbpedia.org/data/Comma-separated_values
The only difference between these two queries is that ?p
is replaced with a
. So it seems that the SPARQL variables cannot capture rdf:type when rdf:type is inferred.
If you are using reasoning, the wildcard in the predicate does capture rdf:type in the result set.
For example, I have the following data
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix dbp: <http://dbpedia.org/data/> . @prefix dct: <http://purl.org/dc/terms/> . @prefix : <http://matonto.org/data/2014/04/inovex/> . :spreadsheet1 dct:format dbp:Comma-separated_values . dct:format rdfs:range dct:MediaTypeOrExtent ;
Query
select ?s ?o where { ?s dct:format ?o . ?o ?p <http://purl.org/dc/terms/MediaTypeOrExtent> . }
The result set is empty.
However, the following query captures the inferred rdf:type in the result set
Query
select ?s ?o where { ?s dct:format ?o . ?o a <http://purl.org/dc/terms/MediaTypeOrExtent> . }
Result Set
The only difference between these two queries is that
?p
is replaced witha
. So it seems that the SPARQL variables cannot capture rdf:type when rdf:type is inferred.
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en