Hi,

We might as well have a direct discussion about defining n-ary relations in
SMW. This came up in an email thread on March 27, and a few suggestions were
raised; let me first go through the suggestions people had (I changed around
some of the data for the sake of consistency between examples), and then
I'll present my own suggestion. The examples are all for a hypothetical page
about the United States, that lists its presidents.

Markus suggested:

[[has president::Bush; 2001; 2008]]

Günther suggested something like:

[[has president::Richard Nixon; 1969; [[end of term:=resignation; 9 August
1974; ; Watergate scandal]] ]]

These are simple solutions that are similar, I believe, to how BOWiki does
it (though I don't think BOWiki's allows for recursiveness). The problem I
see with these (and with BOWiki's) is that they don't define the data;
there's no identifier for the relation of most of these sub-fields. Also,
there's no indication of how the data is to be displayed on the page.

MovGP0 suggested something like:

[[has president::
 [[Person::Richard Nixon]]
began his term in
 [[start of term::
    [[Year::1969]]
 ]]
but
 [[end of term::
    [[Reason::
       [[Type::resignation|resigned]]
because of the
       [[Because::Watergate scandal|]]
on
    [[Date:=1974-08-09|August 9, 1974]]
 ]]
]]

This is, I believe, a better solution, since it gives a relation to each
piece of data, and specifies the display of the data as well. However, it's
recursive, and I don't think there's a need for recursiveness in defining
relations: if Richard Nixon is important enough to the wiki that his reason
for resigning needs to be included, then he or his presidency should
probably have their own page, with the reason placed there (or, if there's
more data, maybe even his *resignation* should have its own page). Allowing
infinite recursiveness would let you, in theory, place all the data of a
wiki onto a single page, which I don't think is a good use of the
technology.

Here, then, is my suggested version:

[[[Has president::
 [[Has name::Richard Nixon]]
began his term in
 [[Start of term::1969]]
and ended his term in
 [[End of term::1974]]
due to a
 [[Reason for end::Resignation]]
]]]

All the data is no more than one level down. Note, also, the triple brackets
that define the main relation. I think it's important to use a tag other
than the usual double-brackets for n-ary relations, for two reasons: first,
double brackets so far have been used to define a single item, not a
free-form area, and second, using another tag would clarify that only two
levels of relations are allowed. I picked triple brackets because it's the
next logical step after double brackets, but any other type of tag could
work as well.

As for the database implementation, it could be pretty simple. There could
be another column in the tables 'smw_relations' and 'smw_attributes' (or
whatever table replaces both of them, if that happens) called, say,
"subject_section_num". For regular relations/attributes, this column would
be null (or 0). For a property that's part of an n-ary relation, it would be
the index of that n-ary relation; the first one on the page would have the
value of "1", etc. This index would be used in defining those relations in
the RDF export, and could also be used to group relations for internal
semantic searching.

Any thoughts on this?

-Yaron
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

Reply via email to