bwanders / dokuwiki-strata

Strata - a Semi-Structured Data plugin for Dokuwiki
https://www.dokuwiki.org/plugin:strata
17 stars 8 forks source link

Multiple entries on one page #41

Open Juergen-aus-Zuendorf opened 7 years ago

Juergen-aus-Zuendorf commented 7 years ago

Hi,

is it possible to define more than on entry on a page? I have tested it, and the result is a little bit confusing for me because I don`t know if I make a mistake in my table definition or if it really doesn't work correctly.

Here is my syntax:

<data person>
Full Name: John
Age: 24
Contact [link]: john@example.org
</data>

<data person>
Full Name: Alice
Age: 28
Contact [link]: alice@example.org
</data>

<table ?person ?contact ?Age>
?person is a: person
?person Contact [link]: ?contact
?person Age: ?Age
</table>

Best regards Juergen

bwanders commented 7 years ago

It works, but you have to indicate yourself which <data> blocks are separate entries and which should simply be combined:

<data person #John>
Full Name: John
Age: 24
Contact [link]: john@example.org
</data>

<data person #Alice>
Full Name: Alice
Age: 28
Contact [link]: alice@example.org
</data>

Note the #Name part. A data block with a different name is seen as a different entry.

(Lack of name is also seen as a separate "name"; which is why your definitino behaves a little weird. Strata thinks you are declaring one person with multiple names, ages and contacts.)

Does this clarify things?

Juergen-aus-Zuendorf commented 7 years ago

Thank you for the explanations!

I use the data plugin for several things in our wiki. But exactly this was a problem for some special tasks, and I hoped that the strata plugin perhaps could solve it.