ontolog-forum
[Top] [All Lists]

Re: [ontolog-forum] fitness of XML for ontology

To: ontolog-forum@xxxxxxxxxxxxxxxx
From: John McClure <jmcclure@xxxxxxxxxxxxxx>
Date: Tue, 04 Feb 2014 11:15:09 -0800
Message-id: <52F13C3D.1060300@xxxxxxxxxxxxxx>
Oops I had an extra } { in the JSON. Also, there are several _javascript_ parsers for Turtle available which do add a slight overhead, no big deal to me. Other serializations include N-triples, RDFa and N3 -- any others? As for XML serialization, there is a non-striped format (which may be the XML format JSowa loathes) which is slightly less comprehensible than the striped format. And my rendition of the striped XML format probably should've used rdf:about, not rdf:id (actually, it should've been rdf:ID if not rdf:about).

3. JSON (revised)

{ "http://www.mysemanticwiki.com/wiki/Person:X" :
  { "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" :
    [ { "value" : "http://www.mysemanticwiki.com/ontology/Nouns.rdf#Person",
        "type"  : "uri"
      }
    ],
    "http://www.mysemanticwiki.com/ontology/is.rdf#this" :
    [ { "value" : "http://www.mysemanticwiki.com/wiki/Man:X",
        "type"  : "uri"
      }
    ]
  }
}


On 2/4/2014 9:54 AM, John McClure wrote:
The triple "Person:X is:this Man:X" has these encodings (from a semantic wiki that requires all its pagenames to contain a 'type' prefix). Draw your own conclusions about each encoding but to me Turtle is superior, followed by XML, and wiping up the rear would be JSON, because JSON has no text entity support unlike the other two. And so, fwiw, I think the claim JSON is a 'lightweight' protocol is somewhat unfounded plus I'm not crazy about an English-only protocol. Feel free to correct me if I've missed anything here. thanks/jmc

1. Striped RDF XML

<!ENTITY rdf   "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY wiki  "http://www.mysemanticwiki.com/wiki/">
<!ENTITY is    "http://www.mysemanticwiki.com/ontology/is.rdf#">
<!ENTITY nouns "http://www.mysemanticwiki.com/ontology/Nouns.rdf#">

<rdf:RDF xml:ns="&nouns;" xmlns:rdf="&rdf;" xmlns:is="&is;">
<Person rdf:id="&wiki;Person:X">
  <is:this rdf:resource="&wiki;Man:X"/>
</Person>
</rdf:RDF>

2. Turtle

@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@prefix wiki: <http://www.mysemanticwiki.com/wiki/>
@prefix is:   <http://www.mysemanticwiki.com/ontology/is.rdf#>
@prefix :     <http://www.mysemanticwiki.com/ontology/Nouns.rdf#>

wiki:Person:X
  rdf:type :Person ;
  is:this  wiki:Man:X
.

3. JSON

{ "http://www.mysemanticwiki.com/wiki/Person:X" :
  { "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" :
    [ { "value" : "http://www.mysemanticwiki.com/ontology/Nouns.rdf#Person",
        "type"  : "uri"
      }
    ]
  },
  { "http://www.mysemanticwiki.com/ontology/is.rdf#this" :
    [ { "value" : "http://www.mysemanticwiki.com/wiki/Man:X",
        "type"  : "uri"
      }
    ]
  }
}

4. Semantic Wiki (bonus!)

<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.5/">
...
<page>
  <title>Person:X</title>
  <revision>
     <text>[[rdf:type :: Person]]
           [[is:this  :: Man:X ]]
     </text>
  </revision>
</page>
</mediawiki>


_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/  
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/  
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/ 
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J    (01)

<Prev in Thread] Current Thread [Next in Thread>