me RDF sestidi

From Lojban
Jump to: navigation, search

This proposal is now in a very rough draft state.

This is a proposal for encoding Lojban texts as a set of RDF triples (possibly quads). The primal intent behind this is to allow precise definition of Lojban structures by decomposition into simple predicates. It will also allow to validate lojban text in respect to types[1] and query it for described facts. Other uses could arise in future.

This document presumes on reader working knowledge of following semantic web topics: RDF and Turle. (It is possible what named graphs and notations to represent them, e.g. Notation 3 and/or TriG, will be needed later). It should be noted that this conversion is not yet intended to be sematic web technology, though it is possible in future.

The examples of conversion will be given in two forms: Turtle (in this version) and simplified representation of RDF triples, with prefixes substituded for full URIs.

Example of conversion

{mi djica lo nu tavla}

Turtle:

@prefix : <http://mw.lojban.org/index.php?title=me_RDF_sestidi&oldid=111997/#ralju:> .
@prefix g: <http://mw.lojban.org/index.php?title=me_RDF_sestidi&oldid=111997/#gismu:> .
@prefix c: <http://mw.lojban.org/index.php?title=me_RDF_sestidi&oldid=111997/#cmavo:> .
@prefix cc: <http://mw.lojban.org/index.php?title=me_RDF_sestidi&oldid=111997/#cmavo-ckaji:> .
@prefix x: <http://mw.lojban.org/index.php?title=me_RDF_sestidi&oldid=111997/#xulta:> .
[                             # main bridi; du'u abstraction
# a :bridi ;
 :sesumti-fa c:mi ;
 :bridi g:djica ;
 :sesumti-fe [                # zo'e of lo
#  a :sumti ;
   a c:zohe ;
   :sumti-fa [                # bridi of lo
     :bridi [                 # abstraction
#      a :selbri ;
       a c:nu ;
       cc:sucta [             # embedded bridi
#        a :bridi ;
         :bridi g:tavla ]]]] ;
 x:cuscu [
#  a :bridi ;
   :sesumti-fa <http://example.com/person1> ;
   :sesumti-fi <http://example.com/person2> ;
   :sesumti-fo <http://example.com/group/lojban/post/1> ]] .

RDF triples:

_:b1 :sesumti-fa c:mi .
_:b1 :bridi g:djica .
_:b1 :sesumti-fe _:z1 .
_:z1 rdf:type c:zohe .
_:z1 :sumti-fa _:b2 .
_:b2 :bridi _:n1 .
_:n1 rdf:type c:nu .
_:n1 cc:sucta _:b3 .
_:b3 :bridi g:tavla .
_:b1 x:cuscu _:x1 .
_:x1 :sesumti-fa <http://example.com/person1> .
_:x1 :sesumti-fi <http://example.com/person2> .
_:x1 :sesumti-fo <http://example.com/group/lojban/post/1>

Converting individual elements

Bridi

As lojban selbri vary in arity, bridi based on them are to be splitted into multiple RDF triples. I choose http://www.w3.org/TR/swbp-n-aryRelations/#useCase3 for this, so for

{mi broda do ma'a da'ai}

corresponding RDF graph will be:

_:b1 :bridi g:broda ;
     :sesumti-fa c:mi ;
     :sesumti-fe c:do ;
     :sesumti-fi c:maha ;
     :sesumti-fo c:dahai .

Gadri

Gadri constructions are first expanded according to http://mw.lojban.org/papri/BPFK_Section:_gadri#Formal_definitions . For now, {noi} is treated just as introducing additional predicates; difference between {poi} and {noi} should be properly encoded later. Examples:

# {lo broda}
_:s1 :sumti-fa [:bridi g:broda] .
# {le broda}
_:s2 :sumti-fe [
     :bridi g:skicu ;
     :sesumti-fa c:mi ;
     :sesumti-fi c:do ;
     :sesumti-fo [
       a c:ka ;
       cc:sucta [
         :sesumt-fa c:cehu ;
         :bridi g:broda ]]] .

Scope operators

Scope operators for now are understood as working on a bridi abstraction. Tense tags are treated as selbri.

 #{na ze'e mi tavla}
 _:b3 :bridi c:na ;              # = g:jitfa
      :sesumti-fa [
        :bridi c:zehe ;
        :sesumti-fa [
          :sesumti-fa c:mi ;
          :bridi g:tavla ]] .

As BAI are uncertain in respect of scope, there is alternate form for they are not create scope abstraction:

 #{mi tavla do bau la lojban}
 _:b4 :bridi :g:tavla ;
      :sesumti-fa c:mi ;
      :sesumti-bau [
        a c:zohe ;
        :sumti-fe [
          :bridi g:cmene ;
          :sumti-fa "lojban" ;
          :sumti-fi c:mi ]] .

This form is experimental and very likely will change in future to accomodate {fi'o .. fe'u}.

Tenses

Modals

Negation

Quantifies

Only outer quantifiers create scope.

#{re prenu cu jukpa}
[
   a c:du
   provisional:quantifier 2
   provisional:variable _:a
   provisional:abstraction [
     :sesumti-fa _:a           # and now I run into a limitation of Turtle - how to describe what _:a is prenu?
     :bridi :jukpa
   ]
]

Connectives

Sumti connectives create scopes as universal and existential quantifiers.

#{mi e do tavla}
[
  a c:du
  provisional:quantifier provisional:all
  provisional:variable _:a
  provisional:abstraction [
    :sesumti-fa _:a           # which are {mi je'u do}
    :bridi :tavla
  ]

]

Abstractions

For now, abstractions are encoded in form [a c:KA ; cc:sucta BRIDI], KA being the type of abstraction and BRIDI, abstracted proposition.

#{du'u mi tavla}
[a c:KA ; cc:sucta [:bridi g:tavla ; :sesumti-fa c:mi ]] .

For {lo du'u} abstraction term, instead bridi itself could be used. Ditto for {lo ka} abstractions and selbri.

#{lo du'u mi tavla}
[:sumti-fa [a c:KA ; cc:sucta [:bridi g:tavla ; :sesumti-fa c:mi ]]]
# or just
[:bridi g:tavla ; :sesumti-fa c:mi ]

Metadata

(TBD)

Next actions

  1. Explain the example step by step.
  2. How RDF semantics interact with Lojban logic[2]? E.g. it seems that [] is more like {da} than {zo'e}
  3. Possibly use http://www.w3.org/2004/03/trix/swp-1/ for x:cuscu (rename it x:xusra?).
  4. Define resources in lojban (e.g. :bridi is {bridi fi zi'o} and :sesumti-FA is {se sumti be fi FA.bu}).
  5. Named graphs could be used for abstactions e.g. cc:sucta {[:bridi g:tavla ]}, but are superfluous now. May be they will be needed for when multiple statements will be introduced?
  6. Do OWL ontology for basic types (types are commented out in the example above). Could be [:bridi ...] used in place of [a :bridi ; :bridi ...] ?

References