Alternative Model Theory for RDF and RDF Schema Here is an alternative model theory for RDF and RDF Schema. Although lots of the details are different from Pat's model theory, from the RDF Core WG, the only really substantive differences are: 1/ the treatment of nodes with literal labels 2/ the addition of XML Schema datatypes, which could be removed without affecting the rest of the model theory 3/ the removal of ICEXT, and not pulling literal values into resources Note that this model theory has not gone through any screening. I have tried to make it as error-free as possible, but there are undoubtably errors remaining. Note also that this is an unofficial and draft model theory. I expect to modify this model theory to conform more closely to the more-official model theory coming from the RDF Core WG, and, hopefully, eliminate it in favour of using that model theory sometime in the future. Peter F. Patel-Schneider RDF Graph Syntax: [NB: I'm sticking with graphs, even though they have some problems for RDF. Triples have their own problems with respect to RDF.] URI is the collection of URI names [NB: This ignores all aspects of the structure of URIs.] L is the collection of literals, disjoint from URI [NB: This model theory handles XML Schema datatypes.] An untidy RDF graph, R, is a four-tuple (that can be considered to be a partially node labeled, directed triple-graph) < N, E, LN > where N is the set of nodes in the graph LN :(partial) N -> URI u L gives labels for nodes E <= N' x N'' x N is the set of edges in the graph where N' = { n : LN(n) is undefined or LN(n) in URI } where N'' = { n : LN(n) is defined and LN(n) in URI } [NB: This accounts for literals not being allowed as ``labels'' of edges, nor as the labels of nodes that are heads of edges, but does not account for edge ``labels'' being properties.] [NB: There are several versions of directed graphs. This one appears to both match intuitions about RDF and make the model theory work.] An untidy RDF graph is ground if LN is a total function on N. A tidy RDF graph (also called an RDF graph) is an untidy RDF graph where LN is injective on URI (but not necessarily total). Literal Values: LV is the union of the value spaces of the primitive XML Schema datatypes, here called the literal value space or datatype domain. The value spaces of primitive XML Schema datatypes are already disjoint so this union does not have to be a disjoint union. [NB: To limit some sorts of inferences, it may be necessary to extend LV with a collection of ``junk'' values.] XLC : URI -> powerset ( LV ), maps URIs that ``point to'' XML Schema datatypes into the value space of that datatype and other URIs to the empty set. [NB: Determining which URIs are XML Schema datatypes must be determined outside of this model theory, as URIs here are atomic.] XLS : L -> powerset ( LV ), maps literals into the set of values that have that literal as a lexical representation for some XML Schema datatype. [NB: The ``meaning'' of a literal is thus left (somewhat) open until RDFS typing information is considered.] [NB: To limit some sorts of inferences, it may be necessary to extend XLS(l) to the ``junk'' values.] Models: Let R = < N, E, LN > be an untidy RDF graph. [NB: These models work for untidy RDF graphs, but it might be useful to only consider tidy RDF graphs from this point on.] A model I for R is a four-tuple < IR, IP, IEXT, IS> where IR is a non-empty set, containing resources IP <= IR, called properties IEXT : IP -> powerset ( IR x (IR u LV) ) IS : N -> IR u LV such that for n, n', s, p, o in N 1. if LN(n) in URI then IS(n) in IR 2. if LN(n) in URI and LN(n) = LN(n') then IS(n) = IS(n') 3. if LN(n) in L then IS(n) in XLS(LN(n)) 4. if is in E then IS(p) in IP and in IEXT(IS(p)) [NB: This works for both ground and non-ground untidy RDF graphs.] [NB: This means that unnamed nodes can map into resources or literal values, unless they appear in the subject position of an edge.] We exploit the uniqueness of URI mappings and say that IS(LN(n)) = IS(n) for n in N with LN(n) in URI Taking care of rdf:type: A core RDF graph, i.e., RDF without reification or containers, is a tidy RDF graph that contains a node with label rdf:type. [NB: The reason to limit to tidy RDF graphs starting here is so that there is a single node for rdf:type, but this restriction is not absolutely necessary.] A core RDF model for a core RDF graph R is a model I for R with the following extra conditions 1. IS(rdf:type) in IP 2. IEXT(IS(rdf:type)) <= IR x IR Now for RDFS: A core RDFS graph is a core RDF graph that contains nodes with the following labels: rdfs:Resource rdf:Property rdfs:Class rdf:type [redundant from RDF] rdfs:subClassOf rdfs:subPropertyOf rdfs:seeAlso rdfs:isDefinedBy rdfs:ConstraintResource rdfs:ConstraintProperty rdfs:range rdfs:domain rdfs:label rdfs:comment rdfs:Literal and the following edges (being a little bit lazy in using labels to identify nodes) [redundant] [redundant from RDF] [redundant] [redundant] [redundant] [redundant] [redundant] A core RDFS model for a core RDFS graph is a core RDF model I for R with the following extra conditions: x in IR iff in IEXT(IS(rdf:type)) x in IP iff in IEXT(IS(rdf:type)) if in IEXT(IS(rdf:type)) and in IEXT(IS(rdfs:subClassOf)) then in IEXT(IS(rdf:type)) [2.3.2] if in IEXT(IS(rdfs:subClassOf)) and in IEXT(IS(rdfs:subClassOf)) then in IEXT(IS(rdfs:subClassOf)) [2.3.2] if in IEXT(r) and in IEXT(IS(rdfs:subPropertyOf)) then in IEXT(s) [2.3.3] if in IEXT(IS(rdfs:subPropertyOf)) and in IEXT(IS(rdfs:subPropertyOf)) then in IEXT(IS(rdfs:subPropertyOf) [2.3.3?] x in IP and in IEXT(IS(rdf:type)) iff in IEXT(IS(rdf:type)) [3.1.2] for y in IR, if in IEXT(p) and in IEXT(IS(rdfs:range)) then in IEXT(IS(rdf:type)) [3.1.3] for y in L, if in IEXT(p) and in IEXT(IS(rdfs:range)) then y in XLC(c) [NB: Yes, this last has a special case for literals, but so what!] [NB: For a literal that is also a URI, both conditions must be met.] if in IEXT(p) and in IEXT(IS(rdfs:domain)) then in IEXT(IS(rdf:type)) [3.1.4] Source of RDFS Vocabulary, Edges, and Constraints: Vocabulary ``Edges'' 2.2.1 rdfs:Resource rdfs:Resource rdf:type rdfs:Class . 2.2.2 rdf:Property rdf:Property rdf:type rdfs:Class . 2.2.3 rdfs:Class rdfs:Class rdf:type rdfs:Class . rdfs:Class rdfs:subClassOf rdfs:Resource. 2.3.1 rdf:type rdf:type rdf:type rdf:Property . rdf:domain rdfs:range rdfs:Resource . [redundant] rdf:type rdfs:range rdfs:Class . 2.3.2 rdfs:subClassOf rdfs:subClassOf rdf:type rdf:Property . rdfs:subClassOf rdf:domain rdfs:Class . rdfs:subClassOf rdf:range rdfs:Class . 2.3.3 rdfs:subPropertyOf rdfs:subPropertyOf rdf:type rdf:Property . rdfs:subClassOf rdf:domain rdfs:Property . rdfs:subClassOf rdf:range rdfs:Property . 2.3.4 rdfs:seeAlso rdfs:seeAlso rdf:type rdf:Property . rdfs:seeAlso rdfs:range rdf:Resource . 2.3.5 rdfs:isDefinedBy rdfs:isDefinedBy rdf:type rdf:Property . rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso . rdfs:isDefinedBy rdfs:range rdf:Resource . 3.1.1 rdfs:ConstraintResource rdfs:ConstraintResource rdfs:subClassOf rdfs:Resource . 3.1.2 rdfs:ConstraintProperty rdfs:ConstraintProperty rdfs:subClassOf rdfs:Resource . rdfs:ConstraintProperty rdfs:subClassOf rdfs:ConstraintResource . 3.1.3 rdfs:range rdfs:range rdfs:type rdfs:ConstraintProperty rdfs:range rdfs:domain rdfs:Property . rdfs:range rdfs:range rdfs:Class . 3.1.3 rdfs:domain rdfs:domain rdfs:type rdfs:ConstraintProperty rdfs:domain rdfs:domain rdfs:Property . rdfs:domain rdfs:range rdfs:Class . 5.1 rdfs:comment rdfs:label rdfs:domain rdfs:Resource . [redundant] rdfs:label rdfs:range rdfs:Literal . 5.2 rdfs:label rdfs:label rdfs:domain rdfs:Resource . [redundant] rdfs:label rdfs:range rdfs:Literal . 6.1 rdfs:Literal rdfs:Literal rdf:type rdfs:Class . Additional Constraints 2.3.2 if in IEXT(IS(rdf:type)) and in IEXT(IS(rdfs:subClassOf) then in IEXT(IS(rdf:type)) 2.3.2 if in IEXT(IS(rdfs:subClassOf) and in IEXT(IS(rdfs:subClassOf) then in IEXT(IS(rdfs:subClassOf) 2.3.3 if in IEXT(r) and in IEXT(IS(rdfs:subPropertyOf)) then in IEXT(s) 2.3.3? if in IEXT(IS(rdfs:subPropertyOf) and in IEXT(IS(rdfs:subPropertyOf) then in IEXT(IS(rdfs:subPropertyOf) 3.1.2 if x in IP and in IEXT(rdf:type) then in IEXT(rdf:type) 3.1.3 if in IEXT(p) and in IEXT(IS(rdfs:range)) then in IEXT(IS(rdf:type)) 3.1.4 if in IEXT(p) and in IEXT(IS(rdfs:domain)) then in IEXT(IS(rdf:type))