Hi,
I have only 5 Citation resources that are linked to some organizations with a isFrom object property. And I want the names of those 5 organizations but the names are asserted with different data sub-properties and I use the super property instead with inference to get all of them.
That query should be very fast, because only 5 Citations and 5 Organizations are involved, but it is very slow. The query plan shows why. The complete organizations are scanned instead of getting directly to the 5 needed organizations.
It seems that the indexes are not used. I am only starting to use reasoning in StarDog and maybe I don't have all the necessary index, stats or something elase. However, I have the following already covered:
(1) All the needed ontologies are in different named graphs and those are registered in the Reasoning Schema Graphs database parameter.
(2) Since I am using named graphs, the index named graphs parameter is set.
(3) The automatic statistics parameter is set.
(4) Since I am doing simple reasoning for now, I have set the reasoning type to RDFS.
Thanks
Distinct [#10]
`─ Projection(?eventDate, ?fromOrg, ?fromOrgNm, ?author, ?authorNm, ?eventText, ?eventLocfrom) [#10]
`─ LoopJoinOuter(_) [#10]
+─ Union [#10]
│ +─ Union [#5]
│ │ +─ Union [#2]
│ │ │ +─ MergeJoin(?fromOrg) [#1]
│ │ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ │ `─ MergeJoin(?author) [#1]
│ │ │ │ │ +─ Sort(?author) [#1]
│ │ │ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ │ │ `─ Scan[PSOC](?author, onto:firstName, ?authorNm) [#2]
│ │ │ │ `─ Scan[PSOC](?fromOrg, <http://ld.thomsonreuters.com/feed/schema/commonName>, ?fromOrgNm) [#5.0M]
│ │ │ `─ MergeJoin(?author) [#1]
│ │ │ +─ Sort(?author) [#1]
│ │ │ │ `─ MergeJoin(?fromOrg) [#1]
│ │ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasAKAName>, ?fromOrgNm) [#1.3M]
│ │ │ `─ Scan[PSOC](?author, onto:firstName, ?authorNm) [#2]
│ │ `─ Union [#3]
│ │ +─ MergeJoin(?author) [#1]
│ │ │ +─ Sort(?author) [#1]
│ │ │ │ `─ MergeJoin(?fromOrg) [#1]
│ │ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasOfficialName>, ?fromOrgNm) [#5.3M]
│ │ │ `─ Scan[PSOC](?author, onto:firstName, ?authorNm) [#2]
│ │ `─ Union [#2]
│ │ +─ MergeJoin(?author) [#1]
│ │ │ +─ Sort(?author) [#1]
│ │ │ │ `─ MergeJoin(?fromOrg) [#1]
│ │ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasShortName>, ?fromOrgNm) [#4.9M]
│ │ │ `─ Scan[PSOC](?author, onto:firstName, ?authorNm) [#2]
│ │ `─ MergeJoin(?author) [#1]
│ │ +─ Sort(?author) [#1]
│ │ │ `─ MergeJoin(?fromOrg) [#1]
│ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ `─ Scan[PSOC](?fromOrg, onto:Organization-name, ?fromOrgNm) [#1]
│ │ `─ Scan[PSOC](?author, onto:firstName, ?authorNm) [#2]
│ `─ MergeJoin(?author) [#5]
│ +─ Sort(?author) [#5]
│ │ `─ Union [#5]
│ │ +─ Union [#2]
│ │ │ +─ MergeJoin(?fromOrg) [#1]
│ │ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ │ `─ Scan[PSOC](?fromOrg, <http://ld.thomsonreuters.com/feed/schema/commonName>, ?fromOrgNm) [#5.0M]
│ │ │ `─ MergeJoin(?fromOrg) [#1]
│ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasAKAName>, ?fromOrgNm) [#1.3M]
│ │ `─ Union [#3]
│ │ +─ MergeJoin(?fromOrg) [#1]
│ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasOfficialName>, ?fromOrgNm) [#5.3M]
│ │ `─ Union [#2]
│ │ +─ MergeJoin(?fromOrg) [#1]
│ │ │ +─ Sort(?fromOrg) [#1]
│ │ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ │ `─ Scan[PSOC](?fromOrg, <http://permid.org/ontology/organization/hasShortName>, ?fromOrgNm) [#4.9M]
│ │ `─ MergeJoin(?fromOrg) [#1]
│ │ +─ Sort(?fromOrg) [#1]
│ │ │ `─ NaryJoin(?cit) [#1]
│ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-text, ?eventText) [#5]
│ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Organization-isFrom, ?fromOrg) [#5]
│ │ │ +─ Scan[PSOC](?cit, onto:PersonCitation-Person-hasAuthor, ?author) [#5]
│ │ │ `─ Scan[PSOC](?cit, onto:PersonCitation-eventDate, ?eventDate) [#5]
│ │ `─ Scan[PSOC](?fromOrg, onto:Organization-name, ?fromOrgNm) [#1]
│ `─ Scan[PSOC](?author, <http://www.w3.org/2006/vcard/ns#given-name>, ?authorNm) [#4.4M]
`─ Empty [#1]