W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > July 2015

Parsing & validating a document

From: Stefan Novak <novast@ohsu.edu>
Date: Wed, 22 Jul 2015 01:30:49 +0000
To: "public-rdf-ruby@w3.org" <public-rdf-ruby@w3.org>
Message-ID: <9183C0AA-64EE-4A2C-80F5-9283EB48AEC8@ohsu.edu>
Hi,

First off, thanks for piecing together a well-rounded library! I really appreciate the documentation and specs available to make it easier to implement RDF in a project of mine.

I’m having a bit of trouble wrapping my head around the best way to implement a Ruby version of the Common Workflow Langauge<file:///Users/novast/common-workflow-language.github.io>.

Specifically, I’m trying to figure out the best way to parse out a Workflow object. I’d appreciate any feedback to get up and running!

My assumptions:

  *   There’s a Turtle schema available<https://rawgit.com/common-workflow-language/common-workflow-language.github.io/master/draft-2/cwl.ttl> that contains a list of classes. I can successfully process that schema as a RDF Schema<https://github.com/ohsu-computational-biology/common_workflow/blob/master/lib/common_workflow/schema.rb#L20>, and convert it to a JSON-LD object<https://github.com/ohsu-computational-biology/common_workflow/blob/master/lib/common_workflow/workflow.rb#L44>.

  *   There’s a JSON-LD context<https://rawgit.com/common-workflow-language/common-workflow-language.github.io/master/draft-2/cwl-context.jsonld> published for the schema. (Thanks for the rdf-turtle gem!)

  *   I can take the above graph from the schema and the context to create the input for a data frame<https://github.com/ohsu-computational-biology/common_workflow/blob/master/lib/common_workflow/workflow.rb#L33>.

  *   With that input, I’m trying to frame a document (a simple CLW workflow<https://github.com/common-workflow-language/common-workflow-language/blob/master/conformance/draft-2/cat1-tool.cwl>), however the object I get back contains just the @context attribute and no @graph property. According to the example in the JSON-LD docs<https://github.com/ruby-rdf/json-ld#frame-a-document>, I was hoping to get a @graph object that I can convert back to an RDF graph object.

So – my questions are:

  1.  Is this the right approach?

  2.  At what point can I validate that my document (i.e., cat1-tool.cwl) conforms to the schema.

  3.  Is it better to traverse the framed document in the JSON-LD form? Or should I convert it back to an RDF graph to traverse / query it there?

Thanks! I appreciate any feedback!
Received on Wednesday, 22 July 2015 11:36:22 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 22 July 2015 11:36:23 UTC