This SPARQL endpoint allows you to query the Computer Science Knowledge Graph (CS-KG).
We encourage all users to familiarise with the CS-KG data model and the full ontology documentation before running queries with this SPARQL endpoint.
A public SPARQL endpoint (based on OpenLink Virtuoso v. 7.2) for querying CS-KG is available at https://scholkg.kmi.open.ac.uk/sparqlendpoint/.
Here you can find a handful of examples to kick-start the exploration of CS-KG.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
SELECT (cskg:sentiment_analysis as ?sub) ?prop ?obj ?sup FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
?t rdf:subject cskg:sentiment_analysis ;
rdf:predicate ?prop ;
rdf:object ?research_entity ;
cskg-ont:hasSupport ?sup .
}
ORDER BY desc (?sup)
LIMIT 100
Given a research entity (e.g., sentiment analysis) and a property (e.g., skos:broader), find all the objects and order the result by support.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT (cskg:sentiment_analysis as ?sub) (skos:broader as ?prop) ?obj ?sup FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
?t rdf:subject cskg:sentiment_analysis ;
rdf:predicate skos:broader ;
rdf:object ?obj ;
cskg-ont:hasSupport ?sup .
}
ORDER BY desc (?sup)
LIMIT 100
Given the material “twitter”, find the tasks where it was used and the list of relevant articles.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
PREFIX provo: <http://www.w3.org/ns/prov#>
SELECT ?sub (cskg-ont:usesMaterial as ?prop) (cskg:twitter as ?obj) ?paperID FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
?t rdf:subject ?sub ;
rdf:predicate cskg-ont:usesMaterial ;
rdf:object cskg:twitter ;
provo:wasDerivedFrom ?paperID .
?sub a cskg-ont:Task
}
LIMIT 100
Find all the statements extracted from the paper with ID 3041690189.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
PREFIX provo: <http://www.w3.org/ns/prov#>
SELECT (cskg:3041690189 as ?paperID) ?sub ?prop ?obj FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
?t rdf:subject ?sub ;
rdf:predicate ?prop ;
rdf:object ?obj ;
provo:wasDerivedFrom cskg:3041690189 .
}
LIMIT 100
Given the research entity cskg:machine_learning, find all the links to external knowledge graph.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
PREFIX dbo: <https://dbpedia.org/ontology/>
SELECT (cskg:machine_learning as ?sub) ?same_entity FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
cskg:machine_learning owl:sameAs ?same_entity
}
LIMIT 100
Find all papers that talk about "machine learning" (i.e., papers associated with statements that have "machine learning" as subject or object).
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX cskg: <http://scholkg.kmi.open.ac.uk/cskg/resource/> # CS-KG resources
PREFIX cskg-ont: <http://scholkg.kmi.open.ac.uk/cskg/ontology#> # CS-KG ontology
PREFIX provo: <http://www.w3.org/ns/prov#>
PREFIX dcterm: <http://purl.org/dc/terms/>
SELECT ?paperID ?paperTitle ?doi ?url FROM <http://scholkg.kmi.open.ac.uk/cskg>
WHERE {
{?t rdf:subject cskg:machine_learning} UNION {?t rdf:object cskg:machine_learning }
?t provo:wasDerivedFrom ?paperID .
?paperID dcterm:title ?paperTitle ;
cskg-ont:hasDOI ?doi ;
cskg-ont:findableAt ?url .
}
LIMIT 100