dasch-swiss / knora-ui

Reusable GUI elements for Knora
https://dasch-swiss.github.io/knora-ui
7 stars 1 forks source link

How should we handle the link value types? #376

Open kilchenmann opened 4 years ago

kilchenmann commented 4 years ago

At the moment with the integration of dasch-swiss/knora-api-js-lib (as part of PR #374) we get the link values twice because of the following response: The entityInfo of a resource has a list of properties, which is needed in case of create new resource or edit existing resource. The following example has the link as #partOf and #partOfValue.

Screen Shot 2019-12-03 at 11 38 36

This is the result in the template:

Screen Shot 2019-12-03 at 11 41 30

I'm not able to filter correctly and I'll need some help from the creator of ReadResource: @tobiasschweizer

tobiasschweizer commented 4 years ago

The linking property and the link value properties belong together. The can be distinguished by boolean flags, see https://github.com/dasch-swiss/knora-api-js-lib/blob/54ec4990f56e82e3738aec7b596a5f0dabce4eaa/src/models/v2/ontologies/resource-property-definition.ts#L31-L35.

flavens commented 4 years ago

@tobiasschweizer indeed we spotted the different boolean flags between the 2 props. But in the UI, how combining both in a logical way (readonly and editable) especially because they have the same label?

tobiasschweizer commented 4 years ago

Example:

{
"@id": "beol:hasAuthor",
"@type": "owl:ObjectProperty",
"knora-api:isEditable": true,
"knora-api:isLinkProperty": true,
"knora-api:isResourceProperty": true,
"knora-api:objectType": {
"@id": "beol:person"
},
"salsah-gui:guiElement": {
"@id": "salsah-gui:Searchbox"
},
"rdfs:comment": "Author",
"rdfs:label": "Author",
"rdfs:subPropertyOf": {
"@id": "knora-api:hasLinkTo"
}
},
{
"@id": "beol:hasAuthorValue",
"@type": "owl:ObjectProperty",
"knora-api:isEditable": true,
"knora-api:isLinkValueProperty": true,
"knora-api:isResourceProperty": true,
"knora-api:objectType": {
"@id": "knora-api:LinkValue"
},
"rdfs:comment": "Author",
"rdfs:label": "Author",
"rdfs:subPropertyOf": {
"@id": "knora-api:hasLinkToValue"
}
},

In a Gravsearch query, beol:hasAuthor is used (the direct link between two resources) to search for a connection. For editing and reading operations, beol:hasAuthorValue is used (the link value).

@benjamingeer I am actually wondering why beol:hasAuthor is flagged as knora-api:isEditable:true. The user can just update the link value, the direct statement is managed by Knora, right?

benjamingeer commented 4 years ago

I guess you’re right, I hadn’t thought of it that way.

flavens commented 4 years ago

I think this point confused me...

tobiasschweizer commented 4 years ago

Ok, I will make an issue for that.

flavens commented 4 years ago

This issue will be resolved with the new viewer structure.