Re: Please publish Turtle or JSON-LD instead of RDF/XML [was Re: Recommendation for transformation of RDF/XML to JSON-LD in a web browser?]

(As it is Friday..)

No, I didn't do RDF inside the XML schema (but see SAWSDL
http://www.w3.org/TR/sawsdl-guide/ and similar Semantic Web Service
approaches) but I for some reason made an XML schema for structuring
XML documents that also happens to be RDF/XML.


In all it's glory:

    http://ns.taverna.org.uk/2010/scufl2.xsd

    XSD-compliant RDF/XML example (close your eyes now!):

    https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-wfbundle/src/test/resources/org/apache/taverna/scufl2/rdfxml/example/workflow/HelloWorld.rdf



RDF was a great tool to structure this XML model, and assigning
identifiers to every bit of the model gave good annotation hooks and
the RDF mapping come for free.

The rigidify of RDF/XML did however mean that the resulting XML feels
unnatural - e.g. <dispatchStack><DispatchStack> double-nesting.

I sketched it out with Turtle, but realised that parsing support for
Turtle was a bit flaky and inconsistent (at the time), and that people
generating it by hand would make even worse mistakes. So RDF/XML it
was.. :-/

Done again today I would have used JSON-LD. The support for JSON
Schemas (or similar) is still a bit flaky - but that is less
important.



XML do have an advantage in that the syntax is very well defined and
XML is easy to validate+parse syntactically and to generate with
generic XML libraries (often built into the programming language). So
for that reason, RDF/XML still has its place - but preferably in the
shadow.


JSON has similar strict syntax characteristics - often annoyingly so -
e.g. you can't end a list with a comma (and hence last item of the
list is special), you can't have comments, you must include : after
keys. That makes it programmatically easier to generate and parse, but
harder to write by hand.

YAML is a format that is easier to read/write manually, and has
JSON-compatible data structure. The flexibility in YAML makes parsing
quite trickier, though. Non-Python folks will not like the strong
semantics of indentation in YAML (but they can add {} ).

There are some cases where you might prefer something like YAML-LD:
http://wiki.cfcl.com/Projects/Arborescence/YAML-LD - as it's trivial
to convert YAML to JSON, and thus to JSON-LD and RDF.

On 4 September 2015 at 12:33, Timothy W. Cook <tim@mlhim.org> wrote:
>
>
> On Fri, Sep 4, 2015 at 7:02 AM, Stian Soiland-Reyes
> <soiland-reyes@cs.manchester.ac.uk> wrote:
>>
>>
>>
>>
>> I must admit I have even done XML Schemas for documents that just
>> happens to be valid RDF/XML documents - (this was before JSON-LD and
>> Turtle were standards) - this was pushing the envelope in both
>> directions (e.g. needing double-nested XML elements, one for the
>> property, and one for the class) and I wouldn't do this again -
>
>
> This is what appinfo elements are for. Sounds you used a very complex
> approach.  Just embed the EDF/XML inside appinfo tags and it is very clean.
>
>
>
>
>
> --
>
> ============================================
> Timothy Cook
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
> MLHIM http://www.mlhim.org
>



-- 
Stian Soiland-Reyes, eScience Lab
School of Computer Science
The University of Manchester
http://soiland-reyes.com/stian/work/    http://orcid.org/0000-0001-9842-9718

Received on Friday, 4 September 2015 13:02:57 UTC