Note: an overview of my thinking on this subject is available.
Abstract
Below is a full N3 OWL description of the closest possible Ontology consistent with the the latest draft-ietf-atompub-format-04 spec.
Status
Work in progress. This is a continual synchronisation and feedback between developing the spec and developing the corresponding ontology.
Rationale
To fulfil the requirements that Atom also provide a model, not just a syntax of the feed format.
By describing the Atom format in machine readable terms, it is much easier to
-
spot inconsistencies in the spec
-
spot redundancies
-
make good progress towards explaining how to extend atom consistently
Atom-OWL in N3
This is the OWL file describing the spec. Please use the Atom-OWL mailing list to discuss problems and suggestions for improvements on this ontology.
Explanation
Many Models of Atom are in fact possible. This one attempts to model Atom in such a way as to be the ontology that backs the AtomRDF goal.
Another way to think of this is that xml is a tree of resources (uri/iris) and text. This is a model of the resources that appear in the atom document. Ie. it is *the* model of the atom document.
Problems
-
Not yet sure how to model TEXT construct
The N3
notes:
-
I have not decided yet whether I should add all the text from the spec in the text below, or just pointers to the spec. So at present there are places where both happen.
-
For those not used to the N3 notation it will be easiest if they view this with the Protégé rdf editor from Stanford university. Download the full version of the editor. It is free and relatively easy to use and understand.
# Base: http://purl.org/atom/# @prefix default: <http://purl.org/atom/#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . default:copyright a owl:DatatypeProperty ; rdfs:comment """see section 4.2.11 for Head and section 5.13 for Entry"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:author a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment """see section 4.2.6 for Head and section 5.5 for Entry"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range default:Person . default:feed a owl:Class ; rdfs:comment """see section 4. of Atom Spec {note: it would be more in sync with convention of class names for feed to be capitalised to \"Feed\"}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:subClassOf owl:Thing ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:head ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:version ] . default:label a owl:DatatypeProperty ; rdfs:comment """see section 3.7.3 { The \"label\" attribute provides a human-readable label that may be displayed in end-user applications. Category constructs MAY have a \"label\" attribute. } {note: should this be a string or a TEXT thing?}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Category ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:agent a owl:DatatypeProperty ; rdfs:comment """see section 4.2.10 { this represents the software agent string I can't find a way to get this to work out quite right. The content of this element is meant to be the content of the agent } """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Generator ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:scheme a owl:ObjectProperty ; rdfs:comment """see section3.7.2 { The is a URI that identifies a categorization scheme. Category constructs MAY have a \"scheme\" attribute. } """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Category . default:contributor a owl:ObjectProperty ; rdfs:comment """see section 4.2.7 for Head ans section 5.6 for Element"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range default:Person . default:Category a owl:Class ; rdfs:comment "see section 3.7"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:subClassOf owl:Thing ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:label ] ; rdfs:subClassOf [ a owl:Restriction ; owl:minCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:term ] . default:origin a owl:DatatypeProperty ; rdfs:comment "see section 5.12"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range <http://www.w3.org/2001/XMLSchema#anyURI> . default:term a owl:DatatypeProperty ; rdfs:comment """see section 3.7.1: {The \"term\" attribute will be a string which identifies the category within the categorization scheme to which the entry or feed belongs. Category constructs MUST have a \"term\" attribute.} """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Category ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:post a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment "see section 4.2.5"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Head ; rdfs:range default:Service . default:link a owl:ObjectProperty ; rdfs:comment """see section 4.2.2 { The \"atom:link\" element is a Link construct that conveys a URI associated with the feed. The nature of the relationship is determined by the construct's rel attribute. atom:head elements MUST contain at least one atom:link element with a rel attribute value of \"alternate\". atom:head elements MUST NOT contain more than one atom:link element with a rel attribute value of \"alternate\" that has the same type attribute value. If a feed's atom:link element with type=\"alternate\" resolves to an HTML document, then that document SHOULD have a autodiscovery link element [Atom-autodiscovery] that reflects back to the feed. atom:head elements MAY contain additional atom:link elements beyond those described above. }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range default:Link . default:uri a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see section 3.2.2 for Person and section 4.2.9 for Generator { note that it may be much more interesting to associate an inverse funtional uri with a person. This means that the person is identified exactly by that uri. One can then use the URI to find other information on the web corresponding to that uri. But then perhaps it would be better if uri were defined a little more presicely}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Person default:Generator) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#anyURI> . default:head a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment """see section 4 for Feed and 5.14 for Entry Construct"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:feed default:Entry) ] ; rdfs:range default:Head . default:host a owl:DatatypeProperty ; rdfs:comment """see section 5.7 {The \"atom:host\" element's content conveys a domain name or network address associated with the entry's origin. atom:entry elements MAY contain a single atom:host element. Its content MUST be a domain name [RFC1035], a dotted-decimal IPv4 address [RFC0791], or a colon-delimited IPv6 address [RFC2460]. }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:Content a owl:Class ; rdfs:comment """see section 5.10 """^^<http://www.w3.org/2001/XMLSchema#string> . default:src a owl:DatatypeProperty ; rdfs:comment """see section 5.12.2 {should this be inverse functional? don't know yet }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Content ; rdfs:range <http://www.w3.org/2001/XMLSchema#anyURI> . default:href a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see section 3.5.3 for link href { The \"href\" attribute contains the link's URI. Link constructs MUST have a href attribute, whose value MUST be a URI reference [RFC2396bis]. xml:base [W3C.REC-xmlbase-20010627] processing MUST be applied to the href attribute's content. } {note: is there an rdf construct that deals with xml:base processing?} and section 3.4.1 for Service href"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Link default:Service) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#anyURI> . default:Atom_ObjectProperty_33 a owl:ObjectProperty . default:name a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see section 3.2.1 {The \"atom:name\" element's content conveys a human-readable name for the person. Person constructs MUST contain exactly one \"atom:name\" element. } {it is not clear why one should reduce the number of names a person has to one}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Person ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:title2 a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see section 4.2.1 {The \"atom:title\" element is a Text construct that conveys a human-readable title for the feed. atom:head elements MUST contain exactly one atom:title element. } { This should point to a new TEXT literal type, which I can't create easily in Prot?©g?©, but which might be possible in RDF } { There is a clash with title from the link construct which can only be of type string }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:hreflang a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see section 3.5.4 {The \"hreflang\" attribute's content describes the language of the resource pointed to by the href attribute. When used together with the rel=\"alternate\", it implies a translated version of the entry. Link constructs MAY have an hreflang attribute, whose value MUST be a language tag [RFC3066]. } """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Link ; rdfs:range <http://www.w3.org/2001/XMLSchema#language> . default:length a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see section 3.5.5: {The \"length\" attribute indicates an advisory length of the linked content in octets; it MAY be used as a hint to determine the content length of the representation returned when the URI in the href attribute is dereferenced. Note that the length attribute does not override the actual content length of the representation as reported by the underlying protocol. Link constructs MAY have a length attribute.}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Link ; rdfs:range <http://www.w3.org/2001/XMLSchema#int> . default:id a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment """see section 4.2.9 for Head and section 5.8 for Entry"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] . default:info a owl:DatatypeProperty ; rdfs:comment """see section 4.2.12 { the range of this property should be a TEXT thing which sounds like a union of 3 different types of literals }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Head ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:title a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see section 3.5.5 { The \"title\" attribute conveys human-readable information about the link. Link constructs MAY have a title attribute.}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Link ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:email a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see section 3.2.3 {this definitively would be better associated with a mailto:.. uri and be inverse functional. IE one should conclude that if two atom person constructs are related to the same mailto uri, thery are the same person} { it also seems a pitty to restrict the number of emails a person can have to one}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Person ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:content a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment "see section 5.12"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range default:Content . default:introspection a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment """see section 4.2.4 """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Head ; rdfs:range default:Service . default:Entry a owl:Class ; rdfs:comment "see section 5 of the Atom spec"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:subClassOf owl:Thing ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:published ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:author ] ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:content ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:updated ] ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:summary ] . default:Service a owl:Class ; rdfs:comment """See section 3.4 """^^<http://www.w3.org/2001/XMLSchema#string> . default:Person a owl:Class ; rdfs:comment """see section 3.2 { A Person construct is an element that describes a person, corporation, or similar entity. Person constructs MAY be extended by namespace-qualified element children. This specification assigns no significance to the order of appearance of the child elements of a Person construct. } """^^<http://www.w3.org/2001/XMLSchema#string> . default:Link a owl:Class ; rdfs:comment """see section 3.5.1 {A Link construct is an empty element that describes a connection from an Atom Document to another Web resource.}"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:subClassOf owl:Thing ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:href ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:rel ] . default:published a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment "see section 5.8"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range <http://www.w3.org/2001/XMLSchema#dateTime> . default:updated a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see section 4.2.13 for Head and section 5.7 for Entry"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#dateTime> . default:generator a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment "see section 4.2.10"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Head ; rdfs:range default:Generator . default:edit a owl:ObjectProperty , owl:FunctionalProperty ; rdfs:comment "see section 5.4"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range default:Service . default:rel a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see 3.5.1 { Link constructs MAY have an optional \"rel\" attribute that indicates the link relation type. If the \"rel\" attribute is not present, the link construct MUST be interpreted as if the link relation type is \"alternate\". rel_attribute = segment-nz-nc / URI The value of \"rel\" MUST be either a name, which is non-empty and does not contain any colon (\":\") characters, or a URI [RFC2396bis]. Note that use of a relative reference to the \"rel\" value URI is not allowed. If a name is given, implementations MUST consider the link relation type to be equivalent to the same name registered within the IANA Registry of Link Relations Section 10, and thus the URI that would be obtained by appending the value of the rel attribute to the string \"http://www.iana.org/assignments/relation/\". The value of \"rel\" describes the meaning of the link, but does not impose any behavioral requirements on implementations. This document defines two initial values for the Registry of Link Relations: The value \"alternate\" signifies that the URI in the value of the href attribute identifies an alternate version of the resource described by the containing element. The value \"related\" signifies that the URI in the value of the href attribute identifies a resource to which the resource described by the containing atom:feed or atom:entry element is related. For example, the feed for a site which discusses the performance of the search engine at \"http://search.example.com\" might contain, as a child of atom:head: <link rel=\"related\" href=\"http://search.example.com/ An identical link might appear as a child of any atom:entry whose content contains a discussion of that same search engine. } """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Link ; rdfs:range [ a owl:DataRange ; owl:oneOf ("alternate"^^<http://www.w3.org/2001/XMLSchema#string> "related"^^<http://www.w3.org/2001/XMLSchema#string>) ] . default:category a owl:ObjectProperty ; rdfs:comment """see section 4.2.3 for Head construct and section 5.3 for Entry construct"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Head default:Entry) ] ; rdfs:range default:Category . default:version a owl:FunctionalProperty , owl:DatatypeProperty ; rdfs:comment """see section 4.1for feed and section 4.2.9 for Generator"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:feed default:Generator) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:tagline a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment "see section 4.2.8"^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Head ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . <http://purl.org/atom/> a owl:Ontology . default:type a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:comment """see 3.5.2 for Link {Link constructs MAY have a type attribute, whose value MUST conform to the syntax of a MIME media type [RFC2045]. The type attribute's value is an advisory media type; it MAY be used as a hint to determine the type of the representation which is expected to be returned when the value of the href attribute is dereferenced. Note that the type attribute does not override the actual media type returned with the representation.} and 5.12.1 for Content. {I am not absolutely sure these are the same properties, though they are very similar } """^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain [ a owl:Class ; owl:unionOf (default:Link default:Content) ] ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> . default:Head a owl:Class ; rdfs:comment """see section 4.2 { The atom:head element acts as a container for metadata about the feed itself. The atom:head element MAY contain any namespace-qualified [W3C.REC-xml-names-19990114] elements as children. This specification assigns no significance to the order of appearance of the child elements of atom:head. }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:subClassOf owl:Thing ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:tagline ] ; rdfs:subClassOf [ a owl:Restriction ; owl:minCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:link ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:id ] ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:post ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:title2 ] ; rdfs:subClassOf [ a owl:Restriction ; owl:maxCardinality "1"^^<http://www.w3.org/2001/XMLSchema#int> ; owl:onProperty default:introspection ] . default:Generator a owl:Class ; rdfs:comment """see section 4.2.10 { The \"atom:generator\" element's content identifies the software agent used to generate the feed, for debugging and other purposes. atom:head elements MAY contain an atom:generator element, but MUST NOT contain more than one. The content of this element, when present, MUST be a string that is a human-readable name for the generating agent. The atom:generator element MAY have a \"uri\" attribute whose value MUST be a URI reference [RFC2396bis]. When dereferenced, that URI SHOULD produce a representation that is relevant to that agent. The atom:generator element MAY have a \"version\" attribute that indicates the version of the generating agent. When present, its value is unstructured text. } { note: This looks like a new type of literal. For some ideas see http://www.w3.org/2001/sw/BestPractices/XSCH/xsch-sw-20041216/ }"""^^<http://www.w3.org/2001/XMLSchema#string> . default:summary a owl:DatatypeProperty ; rdfs:comment """see section 5.9 {This is a TEXT construct, need to find the literal that goes with this }"""^^<http://www.w3.org/2001/XMLSchema#string> ; rdfs:domain default:Entry ; rdfs:range <http://www.w3.org/2001/XMLSchema#string> .