/// <summary>
        /// Gets the value nodes of the given focus node
        /// </summary>
        internal static List <RDFPatternMember> GetValueNodesOf(this RDFGraph dataGraph, RDFShape shape, RDFPatternMember focusNode)
        {
            List <RDFPatternMember> result = new List <RDFPatternMember>();

            if (shape != null && dataGraph != null)
            {
                switch (shape)
                {
                //sh:NodeShape
                case RDFNodeShape nodeShape:
                    result.Add(focusNode);
                    break;

                //sh:PropertyShape
                case RDFPropertyShape propertyShape:
                    if (focusNode is RDFResource)
                    {
                        foreach (var triple in dataGraph.SelectTriplesBySubject((RDFResource)focusNode)
                                 .SelectTriplesByPredicate(((RDFPropertyShape)shape).Path))
                        {
                            result.Add(triple.Object);
                        }
                    }
                    break;
                }
            }
            return(RDFQueryUtilities.RemoveDuplicates(result));
        }
        /// <summary>
        /// Gets the focus nodes of the given shape
        /// </summary>
        internal static List <RDFPatternMember> GetFocusNodesOf(this RDFGraph dataGraph, RDFShape shape)
        {
            List <RDFPatternMember> result = new List <RDFPatternMember>();

            if (shape != null && dataGraph != null)
            {
                foreach (RDFTarget target in shape.Targets)
                {
                    switch (target)
                    {
                    //sh:targetClass
                    case RDFTargetClass targetClass:
                        result.AddRange(dataGraph.GetInstancesOfClass(target.TargetValue)
                                        .OfType <RDFResource>());
                        break;

                    //sh:targetNode
                    case RDFTargetNode targetNode:
                        result.Add(target.TargetValue);
                        break;

                    //sh:targetSubjectsOf
                    case RDFTargetSubjectsOf targetSubjectsOf:
                        result.AddRange(dataGraph.SelectTriplesByPredicate(target.TargetValue)
                                        .Select(x => x.Subject)
                                        .OfType <RDFResource>());
                        break;

                    //sh:targetObjectsOf
                    case RDFTargetObjectsOf targetObjectsOf:
                        result.AddRange(dataGraph.SelectTriplesByPredicate(target.TargetValue)
                                        .Select(x => x.Object)
                                        .OfType <RDFResource>());
                        break;
                    }
                }
            }
            return(RDFQueryUtilities.RemoveDuplicates(result));
        }