コード例 #1
0
        public static bool IsControlledVocabulary(this MetadataProperty metadataProperty, out string range)
        {
            range = metadataProperty.Properties.GetValueOrNull(Constants.Shacl.Range, true);

            if (string.IsNullOrWhiteSpace(range) || range == Constants.Identifier.Type)
            {
                return(false);
            }

            string hasPid = metadataProperty.Properties.GetValueOrNull(Constants.EnterpriseCore.PidUri, true);

            if (hasPid == Constants.Resource.MainDistribution ||
                hasPid == Constants.Resource.Distribution ||
                hasPid == Constants.Resource.BaseUri ||
                hasPid == Constants.RDF.Type ||
                hasPid == Constants.Resource.HasHistoricVersion ||
                hasPid == Constants.Resource.HasLaterVersion ||
                hasPid == Constants.Resource.MetadataGraphConfiguration)
            {
                return(false);
            }

            var groupKey = metadataProperty.GetMetadataPropertyGroup()?.Key;

            if (groupKey == Constants.Resource.Groups.LinkTypes)
            {
                return(false);
            }

            return(metadataProperty.Properties.GetValueOrNull(Constants.Shacl.NodeKind, true) == Constants.Shacl.NodeKinds.IRI);
        }
コード例 #2
0
        public static bool IsTechnicalMetadataProperty(this MetadataProperty metadataProperty)
        {
            var technicalGroups = new List <string>()
            {
                Constants.Resource.Groups.TechnicalInformation, Constants.Resource.Groups.InvisibleTechnicalInformation
            };
            var group = metadataProperty.GetMetadataPropertyGroup();

            return(group != null && technicalGroups.Contains(group.Key));
        }
コード例 #3
0
        private bool LinkTypeMatches(MetadataProperty metadata, string predicate)
        {
            if (predicate == Metadata.Constants.Resource.HasLaterVersion)
            {
                return(true);
            }

            var group = metadata.GetMetadataPropertyGroup();

            return(group != null && group.Key == Metadata.Constants.Resource.Groups.LinkTypes);
        }
コード例 #4
0
        private bool MetadataGroupMatches(MetadataProperty metadata)
        {
            var group = metadata.GetMetadataPropertyGroup();

            return(!string.IsNullOrWhiteSpace(Group) && group != null && group.Key == Group);
        }
        private static bool IsLinkedTypesGroup(MetadataProperty property)
        {
            var shaclGroup = property.GetMetadataPropertyGroup();

            return(null != shaclGroup && shaclGroup.Key == Resource.Groups.LinkTypes);
        }