Last active
August 29, 2015 14:15
-
-
Save 1tylermitchell/5dac304c5cf9495d50f3 to your computer and use it in GitHub Desktop.
SPARQL query for Graph Density ratio
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 (?nrEdges/(?nrNodes *(?nrNodes - 1.0)) AS ?graphDensity) | |
FROM <graphName> | |
WHERE { | |
{ SELECT (COUNT (*) AS ?nrEdges) (COUNT (DISTINCT ?person) AS ?nrNodes) | |
WHERE { ?person <knows> ?anotherPerson . } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment