Relational Model for Notation 3 Persistence

N 3 terms { URIs , ( existential variables ) , Literals , ( universal variables ) , Formula nodes }

N 3 nonLiterals N 3 terms Literals

N 3 graphNames { URIs , , Formula nodes }

N 3 predicateNames N3terms{Literals,}

N 3 classNames N3nonLiteralsFormulanodes

N 3 nonLiterals andLiteralscan be interned and persisted disjointly as two tables with primary keys (using hash functions such as SHA-1 and MD5).

The entire Knowledge Base can be partition into 3 disjoint relations:

I. (Description Logics ABox) {(M,C,G):P(M,C,G)}

C N 3 classNames , M N 3 nonLiterals , G N 3 graphNames

where: P is rdf:type, M is a member of the class C, and G is the name of the graph in which the class membership assertion is made.

II. (Literal Properties) {(S,P,V,D,L,G):P(S,L,G)}

S N 3 nonLiterals , P N 3 predicateNames , V Literal , D URIs

G N 3 graphNames , L { l : l is a language tag }

where: P is the named property, S is the subject of the property, V is the literal value of the property, D (optional) is the datatype associated with the literal, L is the language in which the literal is expressed, and G is the name of the graph in which the property is asserted

III. (All other relations) {(S,P,O,G):P(S,O,G)}

S N 3 nonLiterals , P N 3 predicateNames , O N 3 nonLiterals , G N 3 graphNames

where: P is the named relationships, S is the subject of the relation, O is the object of the relation, and G is the name of the graph in which the relationship is asserted