0

I have inherited a template and I am trying to extend it. The template has a query like this:

[[IsSubjectOf::<q>[[-IsTargetOf::<q>[[HasReferenceDataset::SomeReferenceDataSet]]</q>]]</q>]]

This returns the subjects in the targets that are in the specified ReferenceDataset.

Now we have a new type, ResultSet. A result set contains 1 or more ReferenceDatasets. I want to add one more level of subquery to get the subjects in the targets that are in ReferenceDatasets in the specified ResultSet. I tried this (along with 100 other things):

[[IsSubjectOf::<q>[[-IsTargetOf::<q>[[IsReferenceDatasetOf::<q>[[HasResponseSet::SomeResponseSet]]</q>]]</q>]]</q>]]

But I get nothing back.

[[HasResponseSet::SomeResponseSet]]

Does return the ReferenceDatasets in the ResponseSet, but

[[IsReferenceDatasetOf::<q>[[HasResponseSet::SomeResponseSet]]</q>]]

returns nothing. Anyone see what I am doing wrong here?

Also what is the meaning of the leading - in front of IsTargetOf?

Larry Martell
  • 3,526
  • 6
  • 40
  • 76
  • `-` means implicit inverse property. `-IsTargetOf` is *`IsTagretedBy`. See this: https://www.semantic-mediawiki.org/wiki/Help:Inverse_properties. Inserting a minus before `IsReferenceDatasetOf` might help you. – Alexander Mashin May 07 '22 at 03:18
  • Mage sure that `$smwgQMaxDepth` setting is big enough (https://www.semantic-mediawiki.org/wiki/Help:$smwgQMaxDepth). Also, consider using the dot syntax: https://www.semantic-mediawiki.org/wiki/Help:Subqueries_and_property_chains. – Alexander Mashin May 07 '22 at 03:24
  • Thanks for the replies. I don't think smwgQMaxDepth is a factor as `[[IsReferenceDatasetOf::[[HasResponseSet::SomeResponseSet]]]]` doesn't return anything. Also tried -IsReferenceDatasetOf - no joy – Larry Martell May 09 '22 at 15:04

0 Answers0