Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(api-v2): Add routes for checking whether ontology entities can b…
…e changed (DSP-1621) (#1861)
  • Loading branch information
Benjamin Geer committed May 25, 2021
1 parent e58e463 commit fdd098f
Show file tree
Hide file tree
Showing 26 changed files with 12,494 additions and 8,361 deletions.
70 changes: 69 additions & 1 deletion docs/03-apis/api-v2/ontology-information.md
Expand Up @@ -967,7 +967,7 @@ and the request must have this additional boolean property:
"knora-api:isShared" : true
```

See [Shared Ontologies](knora-iris.md#shared-ontologies) for details about
See [Shared Ontologies](../../02-knora-ontologies/introduction.md#shared-ontologies) for details about
shared ontologies.

A successful response will be a JSON-LD document providing only the
Expand Down Expand Up @@ -1051,6 +1051,23 @@ URL-encoded.
A successful response will be a JSON-LD document containing a
confirmation message.

To check whether a property can be deleted:

```
HTTP GET to http://host/v2/ontologies/candeleteontology/ONTOLOGY_IRI
```

The response will look like this:

```jsonld
{
"knora-api:canDo": false,
"@context": {
"knora-api": "http://api.knora.org/ontology/knora-api/v2#"
}
}
```

### Creating a Class Without Cardinalities

```
Expand Down Expand Up @@ -1558,6 +1575,23 @@ on the corresponding link value property is automatically added (see
A successful response will be a JSON-LD document providing the new class
definition (but not any of the other entities in the ontology).
To check whether a class's cardinalities can be replaced:
```
HTTP GET to http://host/v2/ontologies/canreplacecardinalities/CLASS_IRI
```
The response will look like this:
```jsonld
{
"knora-api:canDo": false,
"@context": {
"knora-api": "http://api.knora.org/ontology/knora-api/v2#"
}
}
```
### Changing the GUI Order of Cardinalities
To change the GUI order of one or more cardinalities in a class:
Expand Down Expand Up @@ -1625,6 +1659,23 @@ will automatically be deleted.
A successful response will be a JSON-LD document providing only the
ontology's metadata.
To check whether a property can be deleted:
```
HTTP GET to http://host/v2/ontologies/candeleteproperty/PROPERTY_IRI
```
The response will look like this:
```jsonld
{
"knora-api:canDo": false,
"@context": {
"knora-api": "http://api.knora.org/ontology/knora-api/v2#"
}
}
```
### Deleting a Class
A class can be deleted only if no other ontology entity refers to it,
Expand All @@ -1639,3 +1690,20 @@ URL-encoded.
A successful response will be a JSON-LD document providing only the
ontology's metadata.
To check whether a class can be deleted:
```
HTTP GET to http://host/v2/ontologies/candeleteclass/CLASS_IRI
```
The response will look like this:
```jsonld
{
"knora-api:canDo": false,
"@context": {
"knora-api": "http://api.knora.org/ontology/knora-api/v2#"
}
}
```
884 changes: 442 additions & 442 deletions test_data/ontologyR2RV2/anythingOntologyWithValueObjects.ttl

Large diffs are not rendered by default.

176 changes: 88 additions & 88 deletions test_data/ontologyR2RV2/anythingThingWithAllLanguages.ttl

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions test_data/ontologyR2RV2/boxOntologyWithValueObjects.ttl
Expand Up @@ -10,75 +10,80 @@ example-box:Box a owl:Class ;
rdfs:comment "A shared thing." ;
rdfs:label "shared thing" ;
rdfs:subClassOf knora-api:Resource ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:creationDate
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:attachedToProject
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:lastModificationDate
owl:onProperty knora-api:deleteComment
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:minCardinality 0 ;
owl:onProperty knora-api:hasStandoffLinkToValue
owl:cardinality 1 ;
owl:onProperty knora-api:attachedToUser
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:minCardinality 0 ;
owl:onProperty knora-api:hasStandoffLinkTo
owl:maxCardinality 1 ;
owl:onProperty knora-api:versionDate
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:isDeleted
owl:onProperty knora-api:deletedBy
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:deleteComment
owl:onProperty knora-api:isDeleted
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:hasPermissions
owl:maxCardinality 1 ;
owl:onProperty knora-api:deleteDate
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:attachedToUser
owl:minCardinality 0 ;
owl:onProperty knora-api:hasStandoffLinkTo
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:userHasPermission
owl:onProperty knora-api:hasPermissions
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:deleteDate
owl:onProperty knora-api:lastModificationDate
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:attachedToProject
] ;
rdfs:subClassOf [ a owl:Restriction ;
salsah-gui:guiOrder 0 ;
owl:maxCardinality 1 ;
owl:onProperty example-box:hasName
owl:minCardinality 0 ;
owl:onProperty knora-api:hasIncomingLinkValue
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:arkUrl
owl:onProperty knora-api:userHasPermission
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:versionArkUrl
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:minCardinality 0 ;
owl:onProperty knora-api:hasIncomingLinkValue
rdfs:subClassOf [ a owl:Restriction ;
salsah-gui:guiOrder 0 ;
owl:maxCardinality 1 ;
owl:onProperty example-box:hasName
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
Expand All @@ -87,18 +92,13 @@ example-box:Box a owl:Class ;
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:deletedBy
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:maxCardinality 1 ;
owl:onProperty knora-api:versionDate
owl:minCardinality 0 ;
owl:onProperty knora-api:hasStandoffLinkToValue
] ;
rdfs:subClassOf [ a owl:Restriction ;
knora-api:isInherited true ;
owl:cardinality 1 ;
owl:onProperty knora-api:creationDate
owl:onProperty knora-api:arkUrl
] ;
knora-api:canBeInstantiated true ;
knora-api:isResourceClass true ;
Expand Down

0 comments on commit fdd098f

Please sign in to comment.