I'm trying to figure out if Jena (or any other SPARQL Update server) will enforce ontological constraints. For example, I want to enforce that only entities which have type x are allowed to have property y and the value of the property must have type z. I think this is what OWL can provide, but I'm not sure. Also, specifically, will Jena ensure that if I try to write a SPARQL Update query which does not follow these rules, that update will fail to insert and an error will be returned?
For example, I want to enforce that only entities which have type x are allowed to have property y and the value of the property must have type z. I think this is what OWL can provide, but I'm not sure.
What you're asking for is not what OWL provides. In OWL, you can say that:
propertyY rdfs:domain typeX
propertyY rdfs:domain typeZ
but this does not mean (at least, in the way that you're expecting), that only things of type X can have values for propertyY, and that the values must be of type Z. What it means is that whenever you see an assertion that uses propertyY, like
a propertyY b
an OWL reasoner can infer that
a rdf:type typeX
b rdf:type typeZ
The only time those inferences will be any kind of "constraint violation" is if you have some other way of inferring that a cannot be of type X, or that b cannot be of type Z. Then an OWL reasoner would recognize the inconsistency.
I'm trying to figure out if Jena (or any other SPARQL Update server) will enforce ontological constraints. … Also, specifically, will Jena ensure that if I try to write a SPARQL Update query which does not follow these rules, that update will fail to insert and an error will be returned?
I don't know whether Jena supports something like this out of the box, but you probably could probably either: