Exploratory SPARQL queries?

Well, the obvious first start is to look at the classes and properties present in the data. Here is how to see what classes are being used: SELECT DISTINCT ?class WHERE { ?s a ?class . } LIMIT 25 OFFSET 0 (LIMIT and OFFSET are there for paging. It is worth getting used to these … Read more

Finding all steps in property path

While there are some limitations in what property paths can do, depending on your exact requirements, you may be able to get what you need here. Consider this data: @prefix : <urn:ex:>. :a :relatedTo :b . :b :relatedTo :c . :c :relatedTo :d . :a :relatedTo :e . :e :relatedTo :f . :f :relatedTo :g … Read more

Calculate length of path between nodes?

This is based on the same technique used to compute the position of an element in an RDF list using SPARQL that is described in: Is it possible to get the position of an element in an RDF Collection in SPARQL? If you have data like this: @prefix : <http://example.org> . :orgA :hasSuborganization :orgB, :orgC, … Read more

tech