This is a very interesting discussion. If there already is code for turning XML into wiki pages with template calls, I'd like to see it; I've actually been planning to add such functionality into the Data Transfer extension (http://www.mediawiki.org/wiki/Extension:Data_Transfer). Currently that extension only does the conversion in the other direction - template calls into XML.

-Yaron


On Thu, Nov 20, 2008 at 5:22 PM, Tempich, Christoph, Dr. <Christoph.Tempich@detecon.com> wrote:
Hi Dan,

I hope I can answer some of your questions.


: "By analogy to database terminology, a Property is a column and a Type is the column's datatype. To extend the analogy, a page in the wiki, containing various pieces of data (Property/Value instances), is like a row of an ad-hock table or query. The page name is therefore the row id in the 'table'."

You are basically right.
A property is a column in a database, or an association in UML (if it links to another class) or an attribute in UML if it links to a Basic Type.

A page is an instance of a class, or a row in data base table. Be careful with the Ids. Links between pages are based on page names. In contrast to IDs in a data base page names should be meaningful. So, instead of linking to IDs, you should link to proper names.

We have a further similarity to data bases.
Class names in UML or Table names are Categories. As Semantic MediaWiki supports subsumption reasoning you can build class hierarchies, which would be more difficult in a data base.

Following the above line of reasoning (based purely on my attempt to understand SMW in terms that I am familiar with), I would create one page for each unique instance of each tables primary key, and add text describing the values of the properties (columns) of each relevant table to that page.

I did this ones, but I used the template feature and than added the semantics in the template.

Assuming you have  three database tables
1. Books (BookId, Title, AuthorId, TopicId)
2. Author (AuthorId, Author name)
3. Topic (TopicId, Topic, SuperTopic)

You should generate wiki pages for each row, which look like

{{Book
|Title=some Title
|Author= some Author
|Topic = some Topic
}}
resulting in semantics like
PAGENAME = some Title
[[title::some Title]] (Property:title hasType::String)
[[Author::some Author]] (Property:Author hasType::PAGE)
[[Category:Topic]]
[[Category:Book]]

{{Author
|name=some Author}}
semantics
PAGENAME = some Author
[[name::some Author]] (Property:name hasType::String)
[[Category:Author]]


{{Topic
|name = some Topic
|superTopic=some superTopic}}
semantics
PAGENAME = Category:some Topic
[[Category:some superTopic]]


For example, is it possible to import XML object models and populate SMW with the underlying data?

Yes, we used XML as source format. I can have a look if I can get hold of the code.

Christoph


-----Ursprüngliche Nachricht-----
Von: Dan Bolser [mailto:dan.bolser@gmail.com]
Gesendet: Donnerstag, 20. November 2008 18:48
An: semediawiki-user@lists.sourceforge.net
Betreff: [Semediawiki-user] Guidelines for "knowledge modelling" in SMW?

Hi all,

I have been reading through the user manual and the list archives to try to get up to speed with SMW (hopefully I can soon spend some time working on a SMW site for work). The manual seems to start off by assuming that the purpose of SMW is to give structure to the data in existing WP style articles (which is a nice way to start), but then starts to deal with topics that go beyond this simple idea. In particular I'm thinking of this page:

http://www.semantic-mediawiki.org/wiki/Help:Properties_and_types


and the section beginning "Properties with multiple types". This section starts to get into the details of data modelling (or knowledge
modelling) within SMW.

For me, the most interesting application of SMW is storing existing sets of structured data. For example, I could easily imagine the following (super)use-case: "Take a normalized MySQL database x and 'dump' it into SMW. Refine data types. Add  additional ad-hock annotations. Implement queries ...".

The part I am interested in is the first part, i.e. how to effectively 'dump' an existing relational database into SMW. My current view of SMW (coming from a relational, not a semantic background), is roughly
: "By analogy to database terminology, a Property is a column and a Type is the column's datatype. To extend the analogy, a page in the wiki, containing various pieces of data (Property/Value instances), is like a row of an ad-hock table or query. The page name is therefore the row id in the 'table'."

Following the above line of reasoning (based purely on my attempt to understand SMW in terms that I am familiar with), I would create one page for each unique instance of each tables primary key, and add text describing the values of the properties (columns) of each relevant table to that page.

My question is this - is this a reasonable way to model data in SMW? I suppose (clearly) there are other ways to 'model data' that don't start from a relational database perspective. For example, is it possible to import XML object models and populate SMW with the underlying data?

Given a 'toy' situation to model, what guidelines could be given about how to implement the model in SMW? Here I think an example would be very informative. I.e. Design a 'SMW' database to describe a simple software library system...

Could such a worked 'knowledge modelling' or 'data modelling' example be added to the user manual? I would try, but where do I get a login from?


Thanks for any comments on any of the above, I think a general set of modelling guidelines could be really useful for beginners, and a specific MySQL to SMW mapping would be invaluable for lots of people wanting to explore the possibilities.

Sorry if I missed the relevant manual pages or mailing list posts.

All the best,
Dan.


--
http://network.nature.com/profile/dan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user