Last active
January 20, 2018 16:17
-
-
Save mommi84/e7e3fda02eeb4e4d6d3dcb725afcd190 to your computer and use it in GitHub Desktop.
SPARQL-based similarity search – Top entities of type X which share characteristics with Y
This file contains 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
SELECT ?s (count(?o) AS ?c) { | |
{ | |
<Y> ?p ?o . | |
?s ?p ?o ; a <X> | |
} UNION { | |
?o ?p <Y> , ?s . | |
?s a <X> | |
} | |
} GROUP BY ?s ORDER BY DESC(?c) LIMIT 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example:
dbo:City
to Y=dbr:Milan
(Live result).