Resources for creating service descriptions

Most if not all service descriptions can be assembled using a set of SPARQL queries that either probe for the database management system (DBMS) backing a SPARQL endpoint or test for the individual features in question.

Probing SPARQL Endpoint

Check this sparql script for currently supported DBMS

REMOTE= sparql-integrate src/main/resources/probe-endpoint-dbms.sparql spo.sparql

Example Output:

_:Be...9 <> <> .
_:Be...9 <> "virtuoso" .
_:Be...9 <> "07.20.3232" .
_:Be...9 <> "OpenLink-Virtuoso-VDB-Server" .
_:Be...9 <> "OpenLink-Virtuoso-VDB-Server:07.20.3232" .

  • Programmatic probing
package org.example;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import org.aksw.jena_sparql_api.rx.RDFDataMgrEx;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.ResourceFactory;


public class ProbeSparqlEndpointDbms {
	public static void main(String[] args) {
		String endpointUrl = "";

		Map<String, String> env = Collections.singletonMap("REMOTE", endpointUrl);

		// Create a model that will hold the report
		Model report = ModelFactory.createDefaultModel();

		// Run the sparql script against the specified remote enppoint
		RDFDataMgrEx.execSparql(report, "probe-endpoint-dbms.sparql", env::get);

		Property dbmsShortNameProperty = ResourceFactory.createProperty("");
		List<String> dbmsShortNames = report.listObjectsOfProperty(dbmsShortNameProperty)
				.mapWith(n -> n.isLiteral() ? Objects.toString(n.asLiteral().getValue()) : null).toList();
		String firstDbmsShortName = Iterables.getFirst(dbmsShortNames, null);

		System.out.println("Probing result: " + firstDbmsShortName)

SPARQL 1.2 Community Group on GitHub