Insert some statements PREFIX <http://bedrock/> INSERT DATA { :fred :hasSpouse :wilma . :fred :hasChild :pebbles . :wilma :hasChild :pebbles . :pebbles :hasSpouse :bamm-bamm ; :hasChild :roxy, :chip. } Insert data into a named graph INSERT DATA { GRAPH <> { <> <> <> } } Inserts into a specific Graph. You can insert as many […]

An example SPARQL query filtering for resources within a given date range (between two given dates). PREFIX c: <> SELECT ?document ?createdDate WHERE { ?document c:created ?createdDate FILTER (?createdDate < “2017-04-18T22:29:33.667Z”^^xsd:dateTime && ?createdDate > “2017-04-18T21:37:37.708Z”^^xsd:dateTime) } LIMIT 100   […]

Order by the highest population Here’s a similar query for DBPedia – this time, ordered by highest population first and filtered by language (“en”). PREFIX type: <> PREFIX prop: <> SELECT ?country_name ?population WHERE { ?country a type:LandlockedCountries ; rdfs:label ?country_name ; prop:populationEstimate ?population . FILTER (?population > 15000000 && langMatches(lang(?country_name), “en”)) . } ORDER […]

SPARQL is the query language for Linked Data and the Semantic Web. It provides new capabilities that you simply cannot get out of traditional SQL and its power to unearth knowledge is amazing. With it, you can perform a distributed or federated query across multiple databases with a single query statement. Because SPARQL endpoints may exist on […]