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

Creating ontology ignores rdfs:comment field (small snafu....) #1690

Closed
lrosenth opened this issue Aug 15, 2020 · 7 comments · Fixed by #1703
Closed

Creating ontology ignores rdfs:comment field (small snafu....) #1690

lrosenth opened this issue Aug 15, 2020 · 7 comments · Fixed by #1703
Assignees
Labels
API/V2 enhancement improve existing code or new feature ontology

Comments

@lrosenth
Copy link
Collaborator

lrosenth commented Aug 15, 2020

When creating an ontology with the API call:

http://0.0.0.0:3333/v2/ontologies (POST)

and the body:

{
  "knora-api:ontologyName" : "onto-with-comment",
  "knora-api:attachedToProject" : {
    "@id" : "http://rdfh.ch/projects/0001"
  },
  "rdfs:comments": "This comment does not arrive in Knora",
  "rdfs:label" : "Ontology with comment",
  "@context" : {
    "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
    "knora-api" : "http://api.knora.org/ontology/knora-api/v2#"
  }
}

the resulting ontology has no comment field, as the resulting json and subsequent queries show:

{
  "@id": "http://0.0.0.0:3333/ontology/0001/onto-with-comment/v2",
  "@type": "owl:Ontology",
  "knora-api:attachedToProject": {
    "@id": "http://rdfh.ch/projects/0001"
  },
  "knora-api:lastModificationDate": {
    "@type": "xsd:dateTimeStamp",
    "@value": "2020-08-15T19:40:27.566182Z"
  },
  "rdfs:label": "Ontology with comment",
  "@context": {
    "knora-api": "http://api.knora.org/ontology/knora-api/v2#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "owl": "http://www.w3.org/2002/07/owl#"
  }
}

Tests being made using postman...

@lrosenth lrosenth added bug something isn't working API/V2 labels Aug 15, 2020
@benjamingeer
Copy link

I’m on holiday, please assign this to @SepidehAlassi

@subotic
Copy link
Collaborator

subotic commented Aug 15, 2020

@lrosenth and please open an issue on YouTrack. We don't use Github for issues anymore.

@SepidehAlassi
Copy link
Contributor

SepidehAlassi commented Aug 17, 2020

User story for this DSP-548

@SepidehAlassi
Copy link
Contributor

@lrosenth when you request an ontology to be created, as a response, the metadata of the ontology is returned. Currently, the comment is not among the metadata information. I can add it though.

@lrosenth
Copy link
Collaborator Author

lrosenth commented Aug 17, 2020 via email

@SepidehAlassi
Copy link
Contributor

@lrosenth Having a closer look at the code, I figured out the following:

with the current design, comments can be given and are taken into account for ontology classes and properties but not for the ontology itself. Please see the example in the documentation

The user can provide a comment for ontology, but it is currently ignored (not parsed out of the JSON-body of the request).

So an ontology comment is neither read during creation from the request nor stored, hence not returned.

This issue is actually not a bug, it is a missing feature. It would need a bit more work than adding a field to the metadata. I will work on it first thing in the coming sprint.

@lrosenth
Copy link
Collaborator Author

lrosenth commented Aug 17, 2020 via email

@SepidehAlassi SepidehAlassi added enhancement improve existing code or new feature ontology and removed bug something isn't working labels Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API/V2 enhancement improve existing code or new feature ontology
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants