in OWL2DTDL/Program.cs [654:684]
internal static bool PropertyAssertionIsDeprecated(INode subj, IUriNode pred, INode obj)
{
IUriNode owlAnnotatedSource = _ontologyGraph.CreateUriNode(OWL.annotatedSource);
IUriNode owlAnnotatedProperty = _ontologyGraph.CreateUriNode(OWL.annotatedProperty);
IUriNode owlAnnotatedTarget = _ontologyGraph.CreateUriNode(OWL.annotatedTarget);
IUriNode owlDeprecated = _ontologyGraph.CreateUriNode(OWL.deprecated);
IEnumerable<INode> axiomAnnotations = _ontologyGraph.Nodes
.Where(node => _ontologyGraph.ContainsTriple(new Triple(node, owlAnnotatedSource, subj)))
.Where(node => _ontologyGraph.ContainsTriple(new Triple(node, owlAnnotatedProperty, pred)))
.Where(node => _ontologyGraph.ContainsTriple(new Triple(node, owlAnnotatedTarget, obj)));
foreach (INode axiomAnnotation in axiomAnnotations)
{
foreach (Triple deprecationAssertion in _ontologyGraph.GetTriplesWithSubjectPredicate(axiomAnnotation, owlDeprecated).Where(trip => trip.Object.NodeType == NodeType.Literal))
{
IValuedNode deprecationValue = deprecationAssertion.Object.AsValuedNode();
try {
if (deprecationValue.AsBoolean())
{
return true;
}
}
catch
{
}
}
}
return false;
}