geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
63 stars 12 forks source link

Datatype Properties not represented as nodes? #71

Open kvarforl opened 3 years ago

kvarforl commented 3 years ago

Moving https://github.com/biolink/ontobio/issues/507 to here, per this comment by @cmungall:

a few things going on here. Looks like something unrelated to ontobio for ttl->rdfxml conversion? both owltools and robot are wrappers to the owlapi, but they may use different versions? if there is a bug it should be reported on the appropriate tracker.

but I think the question here is about the obograph spec. yes, this should be clarified, and yes we should make DPs nodes as we do for OPs. Can you add to obographs?

Example of the issue is here.

julesjacobsen commented 1 year ago

@kvarforl, @saramsey, @cmungall given

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://foo.com/bar> a owl:Class ;
        skos:prefLabel """some node"""@en ;
        <http://foo.com/baz> """test property"""^^xsd:string ;
.

<http://foo.com/baz> a owl:DatatypeProperty ;
    rdfs:label """test label""";
    rdfs:comment """test comment""" .

When converting to OWL using ROBOT

docker run -v $PWD/:/work -w /work --rm -ti obolibrary/robot robot convert --input test.ttl --output test.owl --format owl

and from there into JSON using obographs

java -jar obographs-cli-0.3.1.jar convert test.owl

Then the following YAML file is produced, which contains the PROPERTY node "http://www.w3.org/2004/02/skos/core#prefLabel"

---
graphs:
- nodes:
  - id: "http://foo.com/bar"
    type: "INDIVIDUAL"
    meta:
      basicPropertyValues:
      - pred: "http://www.w3.org/2004/02/skos/core#prefLabel"
        val: "some node"
  - id: "http://foo.com/baz"
    lbl: "test label"
    type: "PROPERTY"
    meta:
      comments:
      - "test comment"
  - id: "http://www.w3.org/2004/02/skos/core#prefLabel"
    type: "PROPERTY"

Can you check this is working as expected here? If so, this would be a duplicate of #90.