-
Notifications
You must be signed in to change notification settings - Fork 18
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
Property inheritance: Knora-base:objectClassConstraint & Knora-base:subjectClassConstraint? #302
Comments
Thanks for this bug report. You're right, this should work the way you expect, but I'm not sure it's feasible. The problem is that property inheritance is easy to implement in the consistency checker and in the Knora API server, but difficult to implement in the SPARQL that does the update to create the resource. That SPARQL update checks that the type of value you submitted matches the property's It would be easy to make the SPARQL work for this particular case. The hard case, however, would be something like this:
Here the |
I managed to implement this in the update SPARQL, but it was too slow on Fuseki. So I think the best thing is to remove these checks from the update SPARQL as per pull request #305. |
It turns out that our GraphDB consistency checking doesn't actually support the inheritance of property predicates, because there is no such inheritance in RDFS. My confusion arose because So I think the sensible thing to do is to completely remove support for inheritance of property predicates from Knora. This means that you'll have to write |
I don't know if I am doing something wrong or if it is a bug I should report for.
Here is the situation:
In my ontology, a property
drawings-gods:internalComment
is shared by several resource classes (drawings-gods:Drawing
,drawings-gods:Instruction
,drawings-gods:CollectionSite
).I defined a property
drawings-gods:internalComment
with a knora-base:objectClassConstraint on knora-base:TextValue. Then, I defined several subproperties of the previous one:drawings-gods:drawingComment
,drawings-gods:instructionComment
,drawings-gods:siteComment
.The
knora-base:subjectClassConstraint
is only defined in the propertydrawings-gods:internalComment
. But differentknora-base:objectClassConstraint
are defined for each subproperty.What I intended to do by modelling data this way is to allow user to search for values in
drawings-gods:internalComment
property, and thus to retrieve results from any of its subproperties (drawings-gods:drawingComment
, etc.).Consistency check passed. Salsah GUI displays correctly the field in the Add resource window.

However, I am unable to create a resource. I get this response:
{"status":27,"error":"org.knora.webapi.UpdateNotPerformedException: Resource http://data.knora.org/j_ByCu-bQLef_c8kzSv7ng was not created. Please report this as a possible bug."}
The error comes from the SPARQL insertion query, which does not insert anything, even if the query looks right (the example is the following file is for a different resource class
drawings-gods:Passage
but you will get the idea: ddd-save-request.txt).The only way I was able to create the resource is when both
knora-base:objectClassConstraint
andknora-base:subjectClassConstraint
were defined within the sub-property itself. So, is it a restriction from the GUI? From the API? From Knora? Is it the intended behaviour or is it a bug?The text was updated successfully, but these errors were encountered: