RE: @id referring to one of several options

Hi Anders

On Thursday, May 01, 2014 11:18 PM, Anders Riutta wrote:
> I'm converting biological pathway data from XML to JSON-LD, and a
> challenge has come up where I need to create a UNION between two @ids.
> 
> My source data has a term "transcription-translation" that can mean
> either transcription or translation.

Is it strictly "either.. or" or is it also possible that is transcription and translation at the same time?

> I'm mapping the data to an
> ontology that contains an @id for transcription
> <identifiers.org/biomodels.sbo/SBO:0000183> and an @id for translation
> <identifiers.org/biomodels.sbo/SBO:0000184>. To represent this data, I
> think something like this is best, but I'd appreciate any suggestions
> on a better way to do it with JSON-LD:

Are those things classes or properties? The capital "S" at the beginning suggest it is a class but your description and the example below indicates that they are properties.

I'm pretty-printing your document to make it a bit clearer what you are doing (no other changes):

  {
    "@context": {
      "@base": "http://identifiers.org/wikipathways/",
      "owl": "http://www.w3.org/2002/07/owl#",
      "biopax": "http://www.biopax.org/release/biopax-level3.owl#",
      "Interaction": "biopax:Interaction",
      "interactionType": "biopax:interactionType",
      "SBO": "http://identifiers.org/biomodels.sbo/SBO:",
      "transcription-translation": {
        "@id": "http://discover.nci.nih.gov/mim/transcription-translation",
        "@value": {
          "owl:unionOf": [
            "SBO:0000183",
            "SBO:0000184"
          ]

You can't put information like this in the context. You have to put it in the body of the document, but I think you are using it wrongly anyway. See below

        }
      }
    },
    "@id": "WP525",
    "@graph": [
      {
        "@id": "sdn602",
        "@type": [
          "Interaction"
        ],
        "interactionType": "transcription-translation"

You probably want to change the definition of "interactionType" in the context to

   "interactionType": { "@id": "biopax:interactionType", "@type": "@id" },

Then, you can set the interaction type to both transcription and translation by just saying

        "interactionType": [ "SBO:0000183", "SBO:0000184" ]


      }
    ]
  }


> If the ontology I'm using had a parent @id that only referred to
> transcription and translation, I could just use that parent @id, but
> in this case, the parent has four children, and I only want to refer
> to two of them.

No, that's not true. It's the other way round. If the child would have referred to multiple parents then you would have had that problem. Otherwise it's fine. But this doesn't apply here anyway (at least not for rdfs:subClassOf relationships) as you are not using rdf:type.

HTH,
Markus


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 1 May 2014 23:32:39 UTC