Last active
December 15, 2015 00:08
-
-
Save tatiana/5170442 to your computer and use it in GitHub Desktop.
Why adding transitivity breaks language filter in SPARQL Query?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix tpedia: <http://tatipedia.org/> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
tpedia:new_york a tpedia:Place ; | |
rdfs:label "Nova Iorque"@pt ; | |
rdfs:label "New York"@en . | |
tpedia:london a tpedia:Place ; | |
rdfs:label "Londres"@pt ; | |
rdfs:label "London"@en . | |
tpedia:name rdf:type owl:DatatypeProperty ; | |
rdfs:subPropertyOf rdfs:label . | |
tpedia:munich a tpedia:Place ; | |
tpedia:name "Munique"@pt ; | |
tpedia:name "Munich"@en . |
The issue was solved using inference.
First, we need to add the inference rule using the Virtuoso ISQL:
rdfs_rule_set ('http://tatipedia.org/property_ruleset', 'http://tatipedia.org');
After this, the query bellow will work as expected:
DEFINE input:inference <http://tpedia.org/property_ruleset>
SELECT DISTINCT ?subject ?label
WHERE {
?subject a <http://tatipedia.org/Place>;
rdfs:label ?label .
FILTER (langMatches(lang(?label), "pt"))
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to build a query to retrieve a list of instances' URIs and rdfs:labels provided:
For this task I have loaded the TTL above into OpenLink Virtuoso OpenSource.
The query bellow:
Returns for this dataset:
Ignoring:
While my intention is:
I tried to fix this problem using transitivity:
But it returned:
Not even applying filters.
Any suggestions?