Package org.hypermedea.ct.rdf
package org.hypermedea.ct.rdf
RDF statements (triples) map to Jason terms of the form:
rdf(S, P, O)[ rdf_type_map(SType, uri, OType) ]
The mapping from RDF node types to Jason may be ambiguous. URIs and string literals map both
to Jason strings. To disambiguate the two, agents can look up the rdf_type_map
annotation, which gives the node type of the triple's subject, predicate and object (note
that the predicate's node type is always uri
). The full mapping is as follows:
RDF type | Jason type | Value of rdf_type_map |
---|---|---|
Named resource (URI) | String | uri |
Blank node | Atom | bnode |
Literal (number) | Number | literal |
Literal (any other type) | String | literal |
For example, the RDF graph and Jason belief base given below are equivalent:
@prefix ex: <http://example.org/> . ex:alice a ex:Person . ex:alice ex:name "Alice" . ex:alice ex:age 42 . ex:alice ex:knows _:someone .
rdf("http://example.org/alice", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "http://example.org/Person") [ rdf_type_map(uri, uri, uri) ] . rdf("http://example.org/alice", "http://example.org/name", "Alice") [ rdf_type_map(uri, uri, literal) ] . rdf("http://example.org/alice", "http://example.org/age", 42) [ rdf_type_map(uri, uri, literal) ] . rdf("http://example.org/alice", "http://example.org/knows", someone) [ rdf_type_map(uri, uri, bnode) ] .
-
Classes