internal static IEnumerable GetAxiomAnnnotations()

in OWL2DTDL/Program.cs [631:651]


        internal static IEnumerable<INode> GetAxiomAnnnotations(INode subj, IUriNode pred, INode obj, IUriNode annotationProperty)
        {
            IUriNode owlAnnotatedSource = _ontologyGraph.CreateUriNode(OWL.annotatedSource);
            IUriNode owlAnnotatedProperty = _ontologyGraph.CreateUriNode(OWL.annotatedProperty);
            IUriNode owlAnnotatedTarget = _ontologyGraph.CreateUriNode(OWL.annotatedTarget);

            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)));

            HashSet<INode> retVal = new HashSet<INode>();
            foreach (INode axiomAnnotation in axiomAnnotations)
            {
                foreach (Triple annotationAssertion in _ontologyGraph.GetTriplesWithSubjectPredicate(axiomAnnotation, annotationProperty))
                {
                    retVal.Add(annotationAssertion.Object);
                }
            }
            return retVal;
        }