Thread:Talk:Semantic Result Formats/Incorrect Sum if more than one property has same numerical value/reply (3)

> Is there any way to avoid needing to manually assign #subobject:n, #subobject:n+1, #subobject:n+2, etc.? It doesn't appear so....

Rather then trying to follow the normal "data hoarding" approach, SMW enforces some conceptional restrictions on how "facts" can and should be modeled (e.g. Help:Category vs. property).

The main object of interest to describe something is the subject (which in most cases is a wikipage) and by assigning a predicate together with a value (e.g. Regimen=1 and Variant=1) one describes this subject though those attributes. If such attributive declaration represents the same "fact" it is handled as the same entity of knowledge (a thing that describes the subject and therefore only appears once).

The same principle about "describing the same thing" is applied to subobjects. If a subobject contains the same declarations then it is being recognized as being the same (technically a hash is produced to compare those entities) unless it describes something different (using an explicit name opposed to the auto-identifier given without an explicit name). Using a different name on a subobject embedded within the same subject creates an independent entity about something that may or may not describe by the same facts.

Doing:

represents the same fact while

are equal in its declaration to produce the same annotation but are different to the end that it represents Subject X#Foo and the other Subject X#Bar. While it may seem to split hairs nevertheless it creates a clear and explicit distinction between those two subobjects.

The same thing can be achieved by using `@sortkey` (those are not equal hence treated as different entities and therefore can be queried individually):

PS: Sorry for the lengthy reply and I hope it explains the issue a bit better.

PSS: If you are unsure about how to model your content, it is always recommended to ask on the Semantic MediaWiki mailing lists for suggestions or if you encounter a technical issue to refer to [0].

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues