Skip to main content Link Menu Expand (external link) Document Search Copy Copied

SPARQL Plugins

The Coypu SPARQL Endpoint has several plugins enabled.

Service Enhancer Plugin

Jena's Service Enhancer plugin enhances the SERVICE clause with capabilities for bulk requests, caching and lateral joins.

For each graph count the use of every property and cache the result. Include a timestamp in order to track when the information was cached.

SELECT * {
  SERVICE <cache:> {
    SELECT ?g ?p (COUNT(*) AS ?c) (NOW() AS ?timestamp) {
      GRAPH ?g { ?s ?p ?o }
    } GROUP BY ?g ?p
  }
  # The cached results can be reused e.g. for filtering.
  # FILTER(regex(str(?p), "type"))
}
ORDER BY DESC(?c)

JenaX Plugins

JenaX is a set of unofficial extensions for Apache Jena. For all supported plugins refer to the JenaX documentation.

Example - RDFS Inferencing against the Coypu Ontology

# Juxtapose results for a certain { ?s a ?o } with RDFS reasoning disabled and enabled
SELECT ?reasoning ?s ?o {
  BIND(<https://data.coypu.org/country/UKR> AS ?s)
  LATERAL {
      { ?s a ?o BIND(false as ?reasoning) }
    UNION
      { SERVICE <sameAs+rdfs:> { ?s a ?o } BIND(true as ?reasoning) }
  }
} ORDER BY ?reasoning