And in the dexpi owl file it is specified that pump is a subclass of equipment, I would have thought that when executing the following query I should get a result, but I don’t get any:
I’d have to look over the spec but I’m not sure if a plain subjectmap is a valid mapping. You can try rewriting it to include a predicateObjectMap with either some additional triple, a dummy triple or you could probably just double up the class assertion. Give that a try and see if that works for you. ( it would be cool if there was an ICV for R2RML files. Something that’s on my list of things to do )
my current workaround is indeed to assign the class pump and Equipment to make sure the SPARQL query works. My question is: Is it possible to only map a subclass and than query only the superior class ?
Nevertheless I also tried a different mapping:
<#ACPEquipmentTableView>
rr:sqlQuery """
SELECT
[PnPID]
,[Tag] as EQPTAG
FROM
[dbo].[Equipment]
WHERE
[Tag] like '%BA%'
""".
<#ADPEQPMAP>
rr:logicalTable <#ACPEquipmentTableView>;
rr:subjectMap [
rr:template "http://autocad.bayer.com/equipment/{PnPID}";
rr:class dexpi:Vessel;
];
rr:predicateObjectMap [
rr:predicate dexpi:TagNameAssignmentClass_of_TaggedPlantItem;
rr:objectMap [ rr:column "EQPTAG" ];
].
And than tried to query it, with no results. (Vessel is also a subclass of Equipment)
Just wanted to followup that indeed a single SubjectMap is a perfectly fine mapping. I should have know that if I had thought about it for a second. I just don't see it very often.
A couple of other things you might want to look at. What is your setting for reasoning.schema.graphs. You might not have loaded your schema in a place that Stardog is look for it. You can try adding a single triple in your main database
:test a dexpi:Vessel
and query against that just to confirm that reasoning is working. (I've had plenty of times where things weren't working as expected and there was some silly typo that was messing things up)
Try checking the setting in the webconsole under "Reasoning over virtual graphs and service clauses" is on. I don't know that the property setting for this is and couldn't find it in the documentation. I doubt that it's the problem since the default is "On" but worth checking.
ps: Got it. The property is reasoning.virtual.graph.enabled