Instantly share code, notes, and snippets.

Embed
What would you like to do?
SPARQL query for Graph Density ratio
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