Re: @id referring to one of several options

Hi Markus, 

Thanks for the response. My answers are inline below. 

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

It technically could be any one of these: 1) transcription, 2) translation, or 3) transcription and translation happening in series. It depends on the level of abstraction and location. 

> 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. 

My example was incorrect. I think they are classes, because they are the object(s) when "interactionType" is the predicate.

> 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 

I was trying to shoehorn the OWL union/intersection concept here < http://www.w3.org/TR/owl-ref/#Boolean > into JSON-LD, but you're right - it doesn't make sense in a JSON-LD context. 

> 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" ] 
> 
> 
> } 
> ] 
> } 

This is a much better solution. Thanks! I've modified the example to look like this, showing DNA represented as Node "bae141" turning into (transcription follow by translation, represented collectively as Edge "sdn602") a protein represented as Node "msz810." I'm not entirely sure about representing pathwayElements (an array with each element either a node or an edge) as @graph.

{
  "@context": {
    "@base": "http://identifiers.org/wikipathways/WP525/",
    "wpId":"http://identifiers.org/wikipathways/",
    "wp": "http://vocabularies.wikipathways.org/wp#",
    "interactsWith": {
      "@id": "wp:interactsWith",
      "@type": "@id"
    },
    "biopax": "http://www.biopax.org/release/biopax-level3.owl#",
    "Interaction": "biopax:Interaction",
    "interactionType": {
      "@id": "biopax:interactionType",
      "@type": "@id"
    },
    "ensembl.metazoa": "http://identifiers.org/ensembl.metazoa/",
    "SBO": "http://identifiers.org/biomodels.sbo/SBO:",
    "pathwayElements": "@graph",
    "interactionGraph": "@graph"
  },
  "@id": "wpId:WP525",
  "pathwayElements": [{
    "@id": "bae141",
    "@type": ["ensembl.metazoa:WBGene00002010"]
  }, {
    "@id": "msz810",
    "@type": ["ensembl.metazoa:C37H5.8"]
  }, {
    "@id": "sdn602",
    "@type": ["Interaction"],
    "interactionType": ["SBO:0000183", "SBO:0000184"],
    "interactionGraph": [{
      "@id": "bae141",
      "interactsWith": "msz810"
    }]
  }]
}

By the way, I recently got back from the Network of BioThings hackathon at Stanford, and JSON-LD appears to be gaining traction in the bioinformatics space. Thanks for the work you've all put into making JSON-LD happen. 

Anders Riutta

----- Original Message ----- 
From: "Markus Lanthaler" <markus.lanthaler@gmx.net> 
To: "Linked JSON" <public-linked-json@w3.org> 
Cc: "Anders Riutta" <anders.riutta@gladstone.ucsf.edu> 
Sent: Thursday, May 1, 2014 4:32:08 PM 
Subject: 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 Friday, 2 May 2014 02:42:32 UTC