Reputation: 53
Imagine I have two RDF (turtle) files, one that contains my custom ontology (a.ttl
) and one that contains values according to the ontology (b.ttl
).
Is it possible to check if b.ttl
is respecting all the definitions defined in a.ttl
using .NET RDF?
I can load a.ttl
using the OntologyGraph
class, can I use this in some way to validate that the graph loaded from b.ttl
is following the specification?
Upvotes: 3
Views: 382
Reputation: 1932
It depends on how your definitions are expressed.
If they are expressed in SHACL, then yes - dotNetRDF supports SHACL validation (which is sadly not yet written up in the docs, but take a look at this sample code).
If they are expressed in OWL, then no - dotNetRDF does not have an OWL inference engine so it cannot determine if your data is consistent with the ontology (in general OWL is actually for asserting new facts, and OWL "validation" is a process of determining if the facts asserted remain consistent with the ontology). You may need to look to one of the reasoners listed here to do this sort of processing.
A simple RDF-Schema based set of constraints (like just subclass, property domain, property range) could probably be converted to SHACL fairly easily, but that would be an additional step to add to your process.
Upvotes: 1