Skip to content

Instantly share code, notes, and snippets.

@doriantaylor
Created May 4, 2023 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doriantaylor/f2fa6f83d2704b40994d621fddad7689 to your computer and use it in GitHub Desktop.
Save doriantaylor/f2fa6f83d2704b40994d621fddad7689 to your computer and use it in GitHub Desktop.
sparql queries for importing into gephi
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?Source ?Target ?Label
WHERE {
?Source ?Label ?Target .
FILTER (!isLITERAL(?Target) && ?Label != rdf:type)
}
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?Id ?Label ?Type
WHERE {
{ ?Id a ?Type . }
{ ?Id skos:prefLabel ?Label } UNION
{ ?Id foaf:name ?Label } UNION
{ ?Id foaf:nick ?Label } UNION
{ ?Id dct:title ?Label } UNION
{ ?Id rdfs:label ?Label } UNION
{ ?Id rdf:value ?Label } UNION
{ ?Id dct:identifier ?Label }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment