Status: Obsolete.
This was written as part of the Semantic Web Toolbox page and spun off. It investigated a syntax for RDF/XML which would be simpler for users than the 'striped' syntax of RDF M&S 1.0. It also looks at the rules for extracting RDF semantics from other non-RDF markup. In this sense it connects with the Top-down functional interpretation of XML You can think of this syntax as Notation 2. A later syntax, Notation 3, was much more successful.
(Within this document, XML elements with namespace prefix are assumed to be defined as pointing to something the reader can figure out, and unprefixed element names are used for new features which are introduced in this document. ).
The major difference between this syntax and RDF 1.0 M&S is that RDF edges
correspond to elements, and RDF nodes are implicit. It is
basically as the M&S syntax with
parseType=resource
is a default.
Basically the things which drove this particular syntax are
I assume for the purposes of the Toolbox page a syntax for data in XML in which XML elements be classified into the following categories.
The element introduces information about an arc in the graph. As nodes in RDF do not inherently have any information apart from their arcs, properties are the only way RDF information actually described. Property elements work as follows:
rdf:for
attribute indicates otherwise for
the subject for one property element. (This is a shortcut)
rdf:about
attribute on any element sets
the default subject for any contained elements. (Equivalent
to RDF M&S)
rdf:fyi
attribute on an element removes
any default subject for the element and its descendants
unless otherwise specified. The RDF parser may ignore the
element and its contents as far as RDF semantics go.
rdf:extend
attribute on any element
indicates that the semantics of the element are of relevance
to the RDF parser and must be interpreted according to the
specification, and where this cannot be done the RDF
semantics are undefined (and typically an error condition
will result from an attempt at evaluation). The element is
known as an RDF-opaque element
rdf:value
attribute that indicates the value of the property. This is
just a shortcut for having it in the element content.
The Semantic context is not changed. And example might be all HTML tags, to make it simple to include RDF in HTML documents (and extract it).
The RDF parser can deduce nothing about the element or its contents, unless it knows the semantics of the element. Example: <sense:room-temperature/>
RDF-Opaque tags are understood by parsers conforming to the namespace they are in.
In the toolbox we will introduce new features which, while they indeed be expressed longhand in the existing XML-RDF notation, in practice need to available in a more concise form at a high level. These are therefore extensions to the RDF-XML syntax for logic. Example: <not>
RDF-Opaque tags in the RDF space are understood by conforming parsers. Other tags are assumed to be property elements if there is subject defined (default or otherwise) and otherwise RDF-Transparent (by default) or Opaque (if specified). Information as to whether tags are RDF-Opaque may be given in the document using them or in a schema (or indeed in principle anywhere else). It may be done element by element, or if applicable, to an en entire namespace.
This syntax was written as have something for examples, and part of the purpose of this is a feasibility of writing logic in XML. I apologise to the reader for the effort required to work in a strange syntax. There was later a call for a simpler syntax and so this was cleaned up a little as a strawman.
Sometimes the effort of creating an element just in order
only to define the subject for a following assertion is a bit
heavy. Making a standard well-known and mandatory understood
attribute would make this easier. Suppose, for example that
rdf:about=foo
always sets the thing to which a
contained property element refers by default, and
rdf:for=bar
overrode it for the element itself.
(rdf:for
would also imply that the element was
an RDF property)
<dc:author rdf:for="thebook" value="Ora"/>
is an easier way of specifying a single property.
<frontm rdf:about="theBook"> <z:date>sdfghjk</z:date> <z:title>Makeing more pancakes</z:title> <z:obsoletes> <!-- default subject is no longer theBook --!> <z:title>Making pankakes</z:title> <z:price>$3.00</z:price> </z:obsoletes> <z:price>$6.00</z:price> <z:price for="anotherBook">$78.00</z:price> </frontm>
(The only problem I have with rdf:about
and
rdf:for
is that it becomes mandatory for any
semantically aware parser to be able to handle this, as
ignoring it is of course impossible.)
When one wants to introduce information about an RDF node, this is basically done by any element with an rdf:about attribute. When there is no other element which conveniently provides a placeholder, the rdf:description element may be used.
<rdf:description rdf:about="theBook"> <dc:author>Ralph</dc:author> <http:from>swick@w3.org</http:from> </rdf:description>
If the rdf:about
attribute is present it
indicates that the node represents a resource (document)
whose URI is that give. That attribute may be omitted.
There are times when using an XML element name for a property may be difficult or impossible, such as when there are many properties to be listed, each from different namespaces, or when the property must take the value of the variable. (Yes, I understand this takes RDF out of first order logic but our ability to quote statements and refer to them I think makes that step anyway).
<rdf:property pname="http://dc.org/dc1#author" rdf:for="theBook" rdf:value="Ralph">
This is also useful as a serialisation syntax when dumping the output of a parser, for example.
See also
There are two ways to put RDF into HTML using these conventions. One could declare that all HTML elements are RDF-transparent, in which case RDF can be stuck in anywhere.
One could bring them closer, so that the RDF subject is set to appropriate URI by convention by declaring them (in RDF schema code inserted into the XHTML schema) to be opaque. In this case, I would propose that HTML's HEAD (or maybe even the HTML document container) be considered as a Node element whose context is the document itself. I would propose that A switch context to the destination of the link - as one often wants a neat way of putting in information about it.
Examples:
Element | RDF subject (URI) |
---|---|
HTML:HTML | The document itself ("") |
HTML:HEAD | The document itself ("") |
HTML:A | The linked document (value of href) |
HTML:BLOCKQUOTE | The quoted document |
References
See also:
So much for syntax: on to the semantic toolbox.