sparql-examples

A set of SPARQL examples that are used in different GerBI resources

View the Project on GitHub German-BioImaging/sparql-examples

001

rq turtle/ttl

Select all projects and list their names and ids.

Use at


PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX omecore: <https://ld.openmicroscopy.org/core/>
PREFIX omekg: <https://ld.openmicroscopy.org/omekg#>
PREFIX obda: <https://w3id.org/obda/vocabulary#>
PREFIX xml: <http://www.w3.org/XML/1998/namespace/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX kv: <http://www.openmicroscopy.org/ns/default/>
PREFIX idr: <https://idr.openmicroscopy.org/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

select ?project ?name ?id where {
  ?project a omecore:Project ;
           rdfs:label ?name ;
           dc:identifier ?id .
  }
order by ?id

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?id"):::projected 
  v3("?name"):::projected 
  v2("?project"):::projected 
  c2([https://ld.openmicroscopy.org/core/Project]):::iri 
  v2 --"a"-->  c2
  v2 --"rdfs:label"-->  v3
  v2 --http://purl.org/dc/elements/1.1/identifier-->  v1