Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@context missing the type definitions in version 0.4.0 #477

Closed
anitacaron opened this issue Dec 11, 2023 · 5 comments · Fixed by #479
Closed

@context missing the type definitions in version 0.4.0 #477

anitacaron opened this issue Dec 11, 2023 · 5 comments · Fixed by #479

Comments

@anitacaron
Copy link
Contributor

anitacaron commented Dec 11, 2023

The new release changed the @context when calling to_json, now only returning prefixes, instead of a complete definition of types in JSON-LD.

Expected @context returned in version 0.3.41

Click to view context version 0.3.41

{
"@context":{
"dcterms":"http://purl.org/dc/terms/",
"linkml":"https://w3id.org/linkml/",
"oboInOwl":"http://www.geneontology.org/formats/oboInOwl#",
"owl":"http://www.w3.org/2002/07/owl#",
"pav":"http://purl.org/pav/",
"prov":"http://www.w3.org/ns/prov#",
"rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs":"http://www.w3.org/2000/01/rdf-schema#",
"semapv":"https://w3id.org/semapv/vocab/",
"skos":"http://www.w3.org/2004/02/skos/core#",
"sssom":"https://w3id.org/sssom/",
"@vocab":"https://w3id.org/sssom/",
"author_id":{
"@type":"@id",
"@id":"pav:authoredBy"
},
"comment":{
"@id":"rdfs:comment"
},
"confidence":{
"@type":"xsd:double"
},
"creator_id":{
"@type":"@id",
"@id":"dcterms:creator"
},
"curation_rule":{
"@type":"@id"
},
"documentation":{
"@type":"@id"
},
"homepage":{
"@type":"@id"
},
"imports":{
"@type":"@id"
},
"issue_tracker":{
"@type":"@id"
},
"issue_tracker_item":{
"@type":"@id"
},
"last_updated":{
"@type":"xsd:date"
},
"license":{
"@type":"@id",
"@id":"dcterms:license"
},
"mapping_cardinality":{
"@context":{
"@vocab":"@null",
"text":"skos:notation",
"description":"skos:prefLabel",
"meaning":"@id"
}
},
"mapping_date":{
"@type":"xsd:date",
"@id":"pav:authoredOn"
},
"mapping_justification":{
"@type":"@id"
},
"mapping_provider":{
"@type":"@id"
},
"mapping_registry_id":{
"@type":"@id"
},
"mapping_set_description":{
"@id":"dcterms:description"
},
"mapping_set_id":{
"@type":"@id"
},
"mapping_set_references":{
"@type":"@id"
},
"mapping_set_source":{
"@type":"@id",
"@id":"prov:wasDerivedFrom"
},
"mapping_set_title":{
"@id":"dcterms:title"
},
"mapping_set_version":{
"@id":"owl:versionInfo"
},
"mapping_source":{
"@type":"@id"
},
"mappings":{
"@type":"@id"
},
"mirror_from":{
"@type":"@id"
},
"object_id":{
"@type":"@id",
"@id":"owl:annotatedTarget"
},
"object_match_field":{
"@type":"@id"
},
"object_preprocessing":{
"@type":"@id"
},
"object_source":{
"@type":"@id"
},
"object_type":{
"@context":{
"@vocab":"@null",
"text":"skos:notation",
"description":"skos:prefLabel",
"meaning":"@id"
}
},
"predicate_id":{
"@type":"@id",
"@id":"owl:annotatedProperty"
},
"predicate_modifier":{
"@context":{
"@vocab":"@null",
"text":"skos:notation",
"description":"skos:prefLabel",
"meaning":"@id"
}
},
"predicate_type":{
"@context":{
"@vocab":"@null",
"text":"skos:notation",
"description":"skos:prefLabel",
"meaning":"@id"
}
},
"publication_date":{
"@type":"xsd:date",
"@id":"dcterms:created"
},
"registry_confidence":{
"@type":"xsd:double"
},
"reviewer_id":{
"@type":"@id"
},
"see_also":{
"@id":"rdfs:seeAlso"
},
"semantic_similarity_score":{
"@type":"xsd:double"
},
"subject_id":{
"@type":"@id",
"@id":"owl:annotatedSource"
},
"subject_match_field":{
"@type":"@id"
},
"subject_preprocessing":{
"@type":"@id"
},
"subject_source":{
"@type":"@id"
},
"subject_type":{
"@context":{
"@vocab":"@null",
"text":"skos:notation",
"description":"skos:prefLabel",
"meaning":"@id"
}
},
"Mapping":{
"@id":"owl:Axiom"
},
"HP":"http://purl.obolibrary.org/obo/HP_",
"MP":"http://purl.obolibrary.org/obo/MP_",
"orcid":"https://orcid.org/",
"obo":"http://purl.obolibrary.org/obo/",
}
}

Click to view context in version 0.4.0

{
"@context":{
"owl":"http://www.w3.org/2002/07/owl#",
"rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs":"http://www.w3.org/2000/01/rdf-schema#",
"semapv":"https://w3id.org/semapv/vocab/",
"skos":"http://www.w3.org/2004/02/skos/core#",
"sssom":"https://w3id.org/sssom/",
"HP":"http://purl.obolibrary.org/obo/HP_",
"MP":"http://purl.obolibrary.org/obo/MP_",
"obo":"http://purl.obolibrary.org/obo/",
"orcid":"https://orcid.org/",
}
}

Is there another method to have the complete @context for JSON-LD file?

@matentzn
Copy link
Collaborator

@anitacaron thank you for the report; there is no test for the JSON serialisation other than checking that the mappings are present.

@cthoyt I missed this during a review of one of your PRs:

c31f44e

We need to undo this change urgently, as this breaks the JSON format; I started doing this here #479

The problem is that the jsonld base from which we originally created the context does not exist anymore. Which means I will have to revive quite a bit of code that was previously removed unfortunately..

How I missed this I cant understand, another reason for small PRs moving forward. Sorry about that @anitacaron.

@cthoyt If I don't hear from you I will roll back the jsonld context related changes.

@hrshdhgd can you find me a valid JSON version of any linkml converted file format? I just want to look how the json files look like..

@cthoyt
Copy link
Member

cthoyt commented Dec 11, 2023

looking into this...

more context about what code you're running would be helpful

@cthoyt
Copy link
Member

cthoyt commented Dec 11, 2023

so is the issue that the get_jsonld_context function loaded up some LinkML artifact that had extra stuff besides the prefix map that we need to retain?

@matentzn
Copy link
Collaborator

This is the consequence of running sssom convert --format json - any example would do.

so is the issue that the get_jsonld_context function loaded up some LinkML artifact that had extra stuff besides the prefix map that we need to retain?

Yes.

@cthoyt
Copy link
Member

cthoyt commented Dec 11, 2023

@anitacaron i updated Nico's PR in #479, it should solve the problem now with minimal changes, we just need to add a unit test to it.

hrshdhgd pushed a commit that referenced this issue Dec 11, 2023
Fixes #477

---------

Co-authored-by: Charles Tapley Hoyt <cthoyt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants