How to install Oracle Java 8 on Ubuntu (in may case, Ubuntu 16.04 LTS) Procedure to install Oracle Java 8 on Ubuntu You probably want to confirm first that a version of Java is not already installed. If so, you can do that with the java -version command as shown below… developer@ubuntu:~$ java -version The program ‘java’ […]

RDF can be expressed in a variety of different serialization formats. It can also be used inline with HTML. Following is an example of the most widely used of these formats so that you can compare them at a glance. RDF/XML An XML-based syntax for RDF graphs that was the first standard format for serializing […]

Return items with recorded date less than given date PREFIX dcterms: <> PREFIX xsd: <> PREFIX web: <> SELECT * WHERE { ?subject dcterms:title ?title. ?subject dcterms:abstract ?abstract. ?subject web:publishDate ?publishDate. FILTER (?publishDate < “2016-09-28T19:19:02.982Z”^^xsd:dateTime) }   […]

Limit the number of results returned PREFIX rdfs: <> PREFIX bc: <> SELECT * WHERE { ?subject bc:hasEmployer <> . ?subject bc:hasBusinessEmail ?email . } LIMIT 5 The LIMIT keyword is used after the WHERE clause, followed by a numerical value. In this case, of course, only 5 results are returned. LIMIT is a solution […]

Find the person entries in Tim Berners-Lee’s FOAF file that do not contain a URL for the person’s FOAF file. Try this on ARQ. PREFIX foaf: <> PREFIX rdfs: <> SELECT ?name FROM <> WHERE { ?person a foaf:Person ; foaf:name ?name . MINUS { ?person rdfs:seeAlso ?url } }   […]

Retrieve the second page of names and emails of people in Tim Berners-Lee’s FOAF file, given that each page has 10 people. Try this on ARQ. PREFIX foaf: <> SELECT ?name ?email FROM <> WHERE { { SELECT DISTINCT ?person ?name WHERE { ?person foaf:name ?name } ORDER BY ?name LIMIT 10 OFFSET 10 } OPTIONAL […]

Is the Amazon river longer than the Nile river? You can also try this one against DBPedia… PREFIX prop: <> ASK { <> prop:length ?amazon . <> prop:length ?nile . FILTER(?amazon > ?nile) . } The answer is: false. Note: The WHERE keyword is optional–not only in ASK queries but in all SPARQL queries. Does […]

Here’s a SPARQL query that counts all statements (triples) in a repository. SELECT (COUNT(?s) AS ?triples) WHERE { ?s ?p ?o } Note that this can be a long running query. For me it took took 21 seconds to count the statements in a repository with 30 million triples. […]

Federate data from 2 endpoints Find the birth dates of all of the actors in Star Trek: The Motion Picture. Try this on ARQ. PREFIX movie: <> PREFIX dbpedia: <> PREFIX foaf: <> SELECT ?actor_name ?birth_date FROM <> # placeholder graph WHERE { SERVICE <> { <> movie:actor ?actor . ?actor movie:actor_name ?actor_name } SERVICE […]