This is probably almost the same question as: Filter by language only if the object is a literal
The problem is that the answer there does not work in my case.
I have this query:
SELECT ?property ?value WHERE { <http://dbpedia.org/resource/Facebook> ?property ?value FILTER(STRSTARTS(STR(?property), "http://dbpedia.org/property") || STRSTARTS(STR(?property), "http://dbpedia.org/ontology"))}
Result at Virtuoso
There you will see a list of properties, including "alexa rating 2" and "abstract" in many languages.
If then I try the proposed solution in the question mentioned above:
SELECT ?property ?value WHERE { <http://dbpedia.org/resource/Facebook> ?property ?value FILTER(STRSTARTS(STR(?property), "http://dbpedia.org/property") || STRSTARTS(STR(?property), "http://dbpedia.org/ontology")) FILTER(!isLiteral(?value) || langMatches(lang(?value), "EN"))}
Result at Virtuoso
Now you will see that there is only an English version of "abstract", but "alexa rating 2" and many other non-string values โโhave disappeared.
Anyone who knows how to get all properties, as in the first query, and then for literals, only filter out the English language?
dbpedia sparql
Marius lian
source share