Skip to content
dgrmunch edited this page Dec 15, 2014 · 16 revisions

xa-language

xa-language, an interoperable human and machine understandable language. It is used as a persistence standard in the xmunch-atomspace (XA). The file persistence.xa keeps a copy of the atomspace in this language. It is a simple language with a small set of rules which can be used to create new atoms in any running instance of XA by using the AtomSpace REST Parser or similar tools.

Rules

  1. Every predicate in xa-language is written in a new line.

  2. Every predicate in xa-language follows an A or B structure.

  3. Every A xa-language predicate follows this structure:

    NAME is_a TYPE [PARAM_1:VALUE_1 ... PARAM_N:VALUE_N]

    • Examples:

       Susan is_a person student:yes age:23 gender:woman
       Peter is_a person age:25 gender:man children:3
       Carolina is_a person
       Madrid is_a city geo-x:40.383333 geo-y:-3.716667
       Europe is_a continent
       Barcelona is_a city has_beach:yes
    
    
  4. Every B xa-language predicate follows this structure:

    NODE_NAME_1 RELATION NODE_NAME_2 [PARAM_1:VALUE_1 ... PARAM_N:VALUE_N]

    • Examples:

       Peter is_friend_of Carolina affinity:0.5
       Madrid is_located_in Europe
       Madrid is_connected_by_road_to Barcelona distance:600 highways:yes
  5. Every B xa-language predicate requires that both NODE_NAME_1 and NODE_NAME_2 have been declared with two A xa-language predicates before.

  6. Elements NAME, TYPE, NODE_NAME, RELATION, PARAM or VALUE can not contain empty spaces ( ) or double quotes ("). Spaces should be replaced by underscore lines (_). Single quotes (') are allowed.

Clone this wiki locally