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

Update ontology entities (part 2) #707

Merged
merged 43 commits into from
Feb 7, 2018
Merged

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Jan 16, 2018

  • Change a property's label or comment.
  • Create a class.
  • Change a class's label or comment.
  • Add cardinalities to a class if it is not used in data.
  • Replace a class's cardinalities with new ones if it is not used in data.
  • Delete a property if it is not used in data or ontologies.
  • Delete a class if it is not used in data or ontologies.
  • After updating an ontology entity, reload it from the triplestore to check that it was saved correctly.
  • Document the ontology API.

If an ontology is created using this API, the ontology inconsistencies discussed in #286 are prevented.

I had to:

  • Refactor the loading and caching of ontologies in OntologyResponderV2.
  • Add support for blank nodes as subjects in SparqlExtendedConstructResponse, because we need them to read cardinalities from a class definition using CONSTRUCT.
  • Undo the SPARQL-escaping of the input after an update, so the input can be compared to the data that was saved in the triplestore.

Resolves #603.
Resolves #579.
Resolves #286.
Resolves #242.
Resolves #157.
Resolves #104.
Resolves #710.

Benjamin Geer added 11 commits January 16, 2018 16:00
- Fix bugs in the comparison of SPARQL-escaped input with data read from the triplestore.
- Refactor SparqlExtendedConstructResponse to distinguish between blank nodes and IRIs.
- Refactor the ontology responder to calculate cardinality inheritance,
  and recalculate class hierarchies, when adding a class definition.
- Do more error-checking.
- Fix getClassDefinition.scala.txt not to return bogus blank nodes.
- Add a test.
@benjamingeer
Copy link
Author

@kilchenmann I think this is ready to use now. Could you please read the documentation in docs/rst/knora-api-server/api_v2/ontology-information.rst and see if it's clear and complete enough?

Copy link
Contributor

@kilchenmann kilchenmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ben. I will have a closer look on it after my vacation.

@benjamingeer
Copy link
Author

@kilchenmann Bon voyage!

Benjamin Geer added 2 commits February 2, 2018 15:37
- Clarify consistency rules in ontology API doc.
- Test edit conflict prevention.
@@ -1,6 +1,10 @@
{
"@type" : "schema:ItemList",
"schema:itemListElement" : [ {
"@id" : "http://data.knora.org/nResNuvARcWYUdWyo0GWGw",
"@type" : "anything:Thing",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like things.


Currently, the only modifiable ontology metadata is the ontology's ``rdfs:label``.

::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

knora-api:hasOntologies is not used here either (see "Creating a New Ontology")

@benjamingeer
Copy link
Author

benjamingeer commented Feb 6, 2018

Review tasks from @tobiasschweizer:

  • When creating an entity, make sure its local name is validated
  • Use hasOntologies to update ontology metadata
  • In tests, if one ontology is expected, check that there's only one
  • Make a separate test for InputOntologiesV2.fromJsonLD
  • When updating an entity, check that it's in the same ontology as the one specified in hasOntologies
  • In addCardinalitiesToClass.scala.txt, check that the class exists
  • Add a boolean isValueClass to value classes in knora-api in the default schema

@benjamingeer
Copy link
Author

@tobiasschweizer Can I merge this now?

@tobiasschweizer
Copy link
Contributor

I will have another look at it just after lunch

Copy link
Contributor

@tobiasschweizer tobiasschweizer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Thx. for the isValueClass flag!

@benjamingeer benjamingeer merged commit f804346 into develop Feb 7, 2018
SepidehAlassi added a commit that referenced this pull request Feb 7, 2018
…basel/Knora into wip/goldbach_beta_release

* 'wip/goldbach_beta_release' of https://github.com/dhlab-basel/Knora:
  Update ontology entities (part 2) (#707)
@tobiasschweizer
Copy link
Contributor

@benjamingeer Can this branch be deleted?

@benjamingeer benjamingeer deleted the wip/ontology-updates-7 branch February 12, 2018 07:19
@benjamingeer
Copy link
Author

Yes thanks!

@tobiasschweizer
Copy link
Contributor

I like deleting things. I believe you do too.

@subotic subotic added this to the v1.2.0 milestone Feb 12, 2018
@benjamingeer benjamingeer mentioned this pull request Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants