Variable-Length Entity Property Paths
SPARQL, the query language for RDF (the Resource Description Framework) supports variable-length property paths. Version 12 provides powerful entity query capabilities by allowing SPARQL queries to be applied to entities.
This example finds daughter nuclides of the mercury-204 "Isotope" entity. Then you can combine a property path query with a SPARQL aggregate to find the isotope with the longest decay chain.
To start, load the GraphStore package.
Define a property path pattern to match the daughter nuclides of mercury-204. A "one or more" path is specified using ".." (Repeated).
To find the isotope with the longest decay chain, first define a query to find all isotope-daughter pairs.
Then define an aggregate that groups by "isotope" and computes—for each group—the length.
Finally, compose query and aggregate, order the result by "length" in descending order and return the first element.