[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] re: RDF considered optional
Jeffrey E. Sussna writes: > The RDF syntax spec states that "The RDF element is optional if the > content can be known to be RDF from the application context." > > Can anyone clarify exactly what is meant by "application context"? That means that if you know in advance what you're reading, you don't need to have an rdf:RDF element. For example, if I define an RDF-based format for exchanging Flight-Simulator scenery information (FSML), and I never intend to embed this in a web page, etc., I can just use something like this: <?xml version="1.0"?> <!-- Yes, Virginia, this is RDF-conformant! --> <fsml:Building xmlns:fsml="http://flightsim.com/ns/fsml#"> <fsml:name>Lennox Generating Station</fsml:name> <fsml:latitude>N44*8'33"</fsml:latitude> <fsml:longitude>W76*51'9"</fsml:longitude> <fsml:length>300m</fsml:length> <fsml:width>150m</fsml:width> </fsml:Building> What's really entertaining is that I can do this, and be RDF-conformant, without even declaring the RDF namespace. The most recent version of SiRPAC that I saw still chokes on this example, but I consider that a bug in SiRPAC (or at least, a deliberate implementation choice). For the curious, here's the basic serialisation syntax for the same thing: <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:fsml="http://flightsim.com/ns/fsml#"> <rdf:Description> <rdf:type resource="http://flightsim.com/ns/fsml#Building"/> <fsml:name>Lennox Generating Station</fsml:name> <fsml:latitude>N44*8'33"</fsml:latitude> <fsml:longitude>W76*51'9"</fsml:longitude> <fsml:length>300m</fsml:length> <fsml:width>150m</fsml:width> </rdf:Description> </rdf:RDF> Actually, this is *not* exactly identical because the RDF spec has a bizarre requirement that when you use rdf:Description explicitly the processor has to build about a zillion extra tuples for reification purposes, whether you want them or not. Go figure. All the best, David -- David Megginson david@m... http://www.megginson.com/ xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|