wiki:SemanticWikiSyntax

Version 10 (modified by fmittag, 15 years ago) (diff)

corrected syntax description

Semantic Wiki Syntax

User Documentation

  • You can use URIs directly in triples, therefor you have to write the URI between this < > pair of brackets. (Of course, Paul and Paula have to be defined semantic keywords.)
     Paul <http://xmlns.com/foaf/0.1/knows> Paula.
    
  • You can define semantic keywords through the predicates isPredicateURIOf and isSubjectURIOf, for example:
    <http://xmlns.com/foaf/0.1/knows> isPredicateURIOf knows.
    <http://xmlns.com/foaf/0.1/Person> isSubjectURIOf Person.
    <http://www.paul.de> isSubjectURIOf Paul.
    <http://www.paula.de> isSubjectURIOf Paula.
    <http://www.julia.de> isSubjectURIOf Julia.
    <http://www.kaiserlautern.de> isSubjectURIOf Kaiserslautern.
    
  • Each statement has to occur in a separate line.
  • To use this defined semantic keywords you only have to use them in your text and end a finished triple with a dot. It may appear at any position on the page. For example:
    Paul knows Paula. 
    Julia knows Paul, Paula. Paula, Paul knows Julia.
    Julia, Paula <http://mywiki.org/ont/livesIn> Kaiserslautern.
    <http://mywiki.org/ont/livesIn> isPredicateURIOf livesIn.
    Paul livesIn Kaiserslautern ; knows Julia.  
    
  • NOTE: The parser will be more pedantic about definitions, so:
    • write only ONE definition per line
    • insert exactly ONE SPACE (from the space key) between subject, predicate and object
    • END every line with a DOT.
  • The RDF formulated can be downloaded using the ViewRDF.jsp and DownloadRDF.jsp pages, accessable through a link on the bottom of the page (at least in the kaukolu design template)
  • Note that any ontologies imported by the RdfsImporter can be edited, too!

Developer Documentation

The parser is de.opendfki.kaukoluwiki.tripleParser.WikiTripleParserHandler. Other classes of interest are

JavaCC may generate (some of) these classes. See build_javacc.xml.


Design Thoughts

As described in the diploma thesis The Gnowsis by Leo, Page 75 (Page 89 inside the PDF).

Basic Rules:

  • (Hans Wurst) -> is the RDF resource with URI http://mywikiurl/wiki/Hand%20Wurst
  • (worksIn) -> is the RDF property with URI http://mywikiurl/wiki/arbeitet
  • (Hans Wurst) (worksIn) in Projekt (Blight). one sentence - one tripel
  • Things in hyphens are Literals "a literal".
  • Current wikis: "(Hans Wurst)" is just a wiki name.
  • Things that cannot be put into triples (because the sentence structure is weird or the property/predicate is missing) are put into a default relation to the page containing them. Example: 'And then blub sais (Nosferatu).' is transfered to <page> <relatedto> <Nosferatu>.

More complex rules:

  • Remove all the junk words between wiki/RDF words (all the stopwords are ignored). Remaining are the sentence marks like dot, comma, semicolon and paragraph-break: . , ; \n
  • take the remaining RDF + sentences and interpret it as N3
  • newlines are like dots: \n -> .

Example for complex rules:

In Sachen (SemDeskPraktikum2005) haben sich Leute angemeldet die (nehmenTeil) sind (!FlorianMittag), (!RalfBiedert);
weiteres ist das (datum) der "2005-11-14".

is stripped down to the most important terms:

SemDeskPraktikum2005 nehmenTeil FlorianMittag, RalfBiedert;
  datum "2005-11-14". 

and then upgraded to be N3 (note that this is real N3 that parses and validates):

@prefix leowiki:     <http://leocomputer.leobard.net/wiki/> .
leowiki:SemDeskPraktikum2005 leowiki:nehmenTeil leowiki:FlorianMittag, leowiki:RalfBiedert;
  leowiki:datum "2005-11-14". 

which is equivalent to these triples (N-TRIPLES):

<http://leocomputer.leobard.net/wiki/SemDeskPraktikum2005> <http://leocomputer.leobard.net/wiki/nehmenTeil> <http://leocomputer.leobard.net/wiki/FlorianMittag>. 
<http://leocomputer.leobard.net/wiki/SemDeskPraktikum2005> <http://leocomputer.leobard.net/wiki/nehmenTeil> <http://leocomputer.leobard.net/wiki/RalfBiedert>.
<http://leocomputer.leobard.net/wiki/SemDeskPraktikum2005> <http://leocomputer.leobard.net/wiki/datum> "2005-11-14". 

This results to these triples, that have to be stored in the RDF database, as created by the wiki page on which they were entered.

A disadvantage is that users cannot write naturally. The clear advantage is that this approach can be implemented in two days during the PraktikumSdt2005. For research we would need something higher, but this comes second.