Perform X3D Ontology query X3dHelloWorldQuery_01.rq using examples/HelloWorld.ttl to produce output file X3dHelloWorldQuery_01.rq.txt: =========================== PREFIX rdf: PREFIX rdfs: PREFIX owl: PREFIX xsd: PREFIX x3d: PREFIX x3do: # X3dHelloWorldQuery_01.rq Query HelloWorld.ttl to count number of Shape nodes, with expected result = 2 nodes. # TODO how to count total and create a unit test for this model? # BIND (count(distinct ?shape) as ?shapeCount) # GROUP BY ?ShapeNodesFound ############################################### SELECT ?ShapeNodesFound ?parentNode ?grandParentNode WHERE { ?shape a x3do:Shape ; # Shorthand expression: a = rdf:type x3do:hasParent ?parent . ?parent x3do:hasParent ?grandParent . # https://stackoverflow.com/questions/11234371/sparql-query-results-without-namespace BIND (strafter(xsd:string(?shape),"#") AS ?ShapeNodesFound) BIND (strafter(xsd:string(?parent),"#") AS ?parentNode) BIND (strafter(xsd:string(?grandParent),"#") AS ?grandParentNode) } ORDER BY (?ShapeNodesFound) # alphabetic order results in scene-graph order given by each name ############################################### -------------------------------------------------------------- | ShapeNodesFound | parentNode | grandParentNode | ============================================================== | "Shape_2_3_2_1" | "TestWhitespaceCommas" | "Group_2_3" | | "Shape_2_3_3_1" | "Transform_2_3_3" | "Group_2_3" | --------------------------------------------------------------