コード例 #1
0
 protected ObjectPropertyAxiom(
     IOntology ontology,
     IObjectPropertyExpression objectPropertyExpression
     ) : base(ontology)
 {
     _objectPropertyExpression = objectPropertyExpression;
 }
コード例 #2
0
ファイル: Axiom.cs プロジェクト: MartinBenjamin/AngularCore
 protected Axiom(
     IOntology ontology
     )
 {
     _ontology = ontology;
     _ontology?.Axioms.Add(this);
 }
コード例 #3
0
 protected Entity(
     IOntology ontology,
     string localName
     ) : base(ontology)
 {
     _localName = localName;
 }
コード例 #4
0
 public DisjointClasses(
     IOntology ontology,
     params IClassExpression[] classExpressions
     ) : base(ontology)
 {
     _classExpressions = classExpressions;
 }
コード例 #5
0
 protected DataPropertyAxiom(
     IOntology ontology,
     IDataPropertyExpression dataPropertyExpression
     ) : base(ontology)
 {
     _dataPropertyExpression = dataPropertyExpression;
 }
コード例 #6
0
 public EquivalentClasses(
     IOntology ontology,
     params IClassExpression[] classExpressions
     ) : base(ontology)
 {
     _classExpressions = classExpressions;
 }
コード例 #7
0
        public static IDictionary <object, ILookup <IPropertyExpression, ISubClassOf> > Validate(
            this IOntology ontology,
            IDictionary <object, ISet <IClass> > classifications
            )
        {
            var evaluator = new ClassMembershipEvaluator(
                ontology,
                classifications);

            return((
                       from keyValuePair in classifications
                       let individual = keyValuePair.Key
                                        from classExpression in keyValuePair.Value
                                        from subClassOf in ontology.Get <ISubClassOf>()
                                        from annotation in subClassOf.Annotations
                                        where
                                        subClassOf.SubClassExpression == classExpression &&
                                        subClassOf.SuperClassExpression is IPropertyRestriction &&
                                        annotation.Property.Iri == "Validation.Restriction" &&
                                        !subClassOf.SuperClassExpression.Evaluate(
                           evaluator,
                           individual)
                                        group subClassOf by individual into errorsGroupedByIndividual
                                        select errorsGroupedByIndividual
                       ).ToDictionary(
                       group => group.Key,
                       group => group.ToLookup(
                           g => ((IPropertyRestriction)g.SuperClassExpression).PropertyExpression)));
        }
コード例 #8
0
        /// <summary>Adds another built in ontology into this provider instance.</summary>
        /// <param name="ontologies">Ontologiesto be included in this instance.</param>
        /// <returns>This instance of the default ontologies provider.</returns>
        public DefaultOntologiesProvider Include(BuiltInOntologies ontologies)
        {
            foreach (BuiltInOntologies ontology in Enum.GetValues(typeof(BuiltInOntologies)))
            {
                if (((ontologies & ontology) == ontology) && (!_includedOntologies.Contains(ontology)))
                {
                    string resourceName = System.String.Format("{0}.{1}.", typeof(DefaultOntologiesProvider).Namespace, ontology.ToString());
                    resourceName = (from manifestResourceName in GetType().GetTypeInfo().Assembly.GetManifestResourceNames()
                                    where manifestResourceName.StartsWith(resourceName)
                                    select manifestResourceName).FirstOrDefault();
                    if (System.String.IsNullOrEmpty(resourceName))
                    {
                        throw new System.IO.FileNotFoundException(System.String.Format("No embedded ontology stream found for '{0}'.", ontology.ToString()));
                    }

                    IOntology ontologyInstance = _ontologyFactory.Create(
                        GetType().GetTypeInfo().Assembly.GetManifestResourceStream(resourceName),
                        "application/" + (resourceName.EndsWith(".owl") ? "owl" : "rdf") + "+xml");
                    if (ontologyInstance != null)
                    {
                        _includedOntologies.Add(ontology);
                        _ontologies.Add(ontologyInstance);
                    }
                }
            }

            return(this);
        }
コード例 #9
0
 public AnnotationProperty(
     IOntology ontology,
     string localName
     ) : base(
         ontology,
         localName)
 {
 }
コード例 #10
0
 public Datatype(
     IOntology ontology,
     string localName
     ) : base(
         ontology,
         localName)
 {
 }
コード例 #11
0
ファイル: Class.cs プロジェクト: MartinBenjamin/AngularCore
 public Class(
     IOntology ontology,
     string localName
     ) : base(
         ontology,
         localName)
 {
 }
コード例 #12
0
 public static IObjectPropertyExpression DeclareObjectProperty <T, TProperty>(
     this IOntology ontology,
     string localName,
     Func <T, IEnumerable <TProperty> > property
     ) => new ObjectProperty <T, TProperty>(
     ontology,
     localName,
     property);
コード例 #13
0
 public NamedIndividual(
     IOntology ontology,
     string localName
     ) : base(
         ontology,
         localName)
 {
 }
コード例 #14
0
 public ClassAssertion(
     IOntology ontology,
     IClassExpression classExpression,
     INamedIndividual namedIndividual
     ) : base(ontology)
 {
     _classExpression = classExpression;
     _namedIndividual = namedIndividual;
 }
コード例 #15
0
 /// <summary>Creates a new instance of <see cref="OntologyAccessor"/>.</summary>
 internal OntologyAccessor(Entity entity, IOntology ontology, INodeConverter nodeConverter, IResultTransformerCatalog resultTransformers)
 {
     _tripleStore        = entity.Context.Store;
     _entity             = entity;
     _ontology           = ontology;
     _resultTransformers = resultTransformers;
     _nodeConverter      = nodeConverter;
     _context            = entity.Context;
 }
コード例 #16
0
 protected PropertyAssertion(
     IOntology ontology,
     IPropertyExpression propertyExpression,
     INamedIndividual sourceIndividual
     ) : base(ontology)
 {
     _propertyExpression = propertyExpression;
     _sourceIndividual   = sourceIndividual;
 }
コード例 #17
0
 public SubClassOf(
     IOntology ontology,
     IClassExpression subClassExpression,
     IClassExpression superClassExpression
     ) : base(ontology)
 {
     _subClassExpression   = subClassExpression;
     _superClassExpression = superClassExpression;
 }
コード例 #18
0
 public HasKey(
     IOntology ontology,
     IClassExpression classExpression,
     params IDataPropertyExpression[] dataPropertyExpressions
     ) : base(ontology)
 {
     _classExpression         = classExpression;
     _dataPropertyExpressions = dataPropertyExpressions;
 }
コード例 #19
0
 public ObjectPropertyDomain(
     IOntology ontology,
     IObjectPropertyExpression objectPropertyExpression,
     IClassExpression domain
     ) : base(
         ontology,
         objectPropertyExpression)
 {
     _domain = domain;
 }
コード例 #20
0
 public FunctionalObjectProperty(
     IOntology ontology,
     string localName,
     Func <T, TProperty> property
     ) : base(
         ontology,
         localName,
         property)
 {
 }
コード例 #21
0
 public DataProperty(
     IOntology ontology,
     string localName,
     Func <T, IEnumerable <TProperty> > property
     ) : base(
         ontology,
         localName,
         property)
 {
 }
コード例 #22
0
 public ObjectPropertyRange(
     IOntology ontology,
     IObjectPropertyExpression objectPropertyExpression,
     IClassExpression range
     ) : base(
         ontology,
         objectPropertyExpression)
 {
     _range = range;
 }
コード例 #23
0
 public DataPropertyDomain(
     IOntology ontology,
     IDataPropertyExpression dataPropertyExpression,
     IClassExpression domain
     ) : base(
         ontology,
         dataPropertyExpression)
 {
     _domain = domain;
 }
コード例 #24
0
 protected FunctionalProperty(
     IOntology ontology,
     string localName,
     Func <T, TProperty> property
     ) : base(
         ontology,
         localName)
 {
     _property = property;
 }
コード例 #25
0
 public DataPropertyRange(
     IOntology ontology,
     IDataPropertyExpression dataPropertyExpression,
     IDataRange range
     ) : base(
         ontology,
         dataPropertyExpression)
 {
     _range = range;
 }
コード例 #26
0
 protected Property(
     IOntology ontology,
     string localName,
     Func <T, IEnumerable <TProperty> > property
     ) : base(
         ontology,
         localName)
 {
     _property = property;
 }
コード例 #27
0
 public DataPropertyAssertion(
     IOntology ontology,
     IDataPropertyExpression dataPropertyExpression,
     INamedIndividual sourceIndividual,
     object targetValue
     ) : base(
         ontology,
         dataPropertyExpression,
         sourceIndividual)
 {
     _dataPropertyExpression = dataPropertyExpression;
     _targetValue            = targetValue;
 }
コード例 #28
0
 public ObjectPropertyAssertion(
     IOntology ontology,
     IObjectPropertyExpression objectPropertyExpression,
     INamedIndividual sourceIndividual,
     object targetIndividual
     ) : base(
         ontology,
         objectPropertyExpression,
         sourceIndividual)
 {
     _objectPropertyExpression = objectPropertyExpression;
     _targetIndividual         = targetIndividual;
 }
コード例 #29
0
        /// <summary>Creates an ontology from given stream.</summary>
        /// <param name="fileStream">Stream containing a serialized ontology data.</param>
        /// <param name="contentType">Explicitly passed content type of the data stored in the given stream.</param>
        /// <returns>Ontology beeing an object representation of given data.</returns>
        public IOntology Create(Stream fileStream, string contentType)
        {
            IOntologyLoader ontologyFactory = GetOntologyFactory(contentType);

            if (ontologyFactory == null)
            {
                throw new NotSupportedException(System.String.Format("MIME type of '{0}' is not supported.", contentType));
            }

            IOntology result = ontologyFactory.Create(fileStream);

            fileStream.Dispose();
            return(result);
        }
コード例 #30
0
ファイル: OntologyState.cs プロジェクト: HuZeHua/InternetDemo
 public static OntologyState Create(IOntology ontology)
 {
     if (ontology == null)
     {
         throw new ArgumentNullException("ontology");
     }
     return(new OntologyState(ontology.Id)
     {
         CanAction = ontology.CanAction,
         CanCommand = ontology.CanCommand,
         CanEvent = ontology.CanEvent,
         Code = ontology.Code,
         CreateOn = ontology.CreateOn,
         DispatcherLoadCount = ontology.DispatcherLoadCount,
         DispatcherSleepTimeSpan = ontology.DispatcherSleepTimeSpan,
         EntityDatabaseId = ontology.EntityDatabaseId,
         EntityProviderId = ontology.EntityProviderId,
         EntitySchemaName = ontology.EntitySchemaName,
         EntityTableName = ontology.EntityTableName,
         ExecutorLoadCount = ontology.ExecutorLoadCount,
         ExecutorSleepTimeSpan = ontology.ExecutorSleepTimeSpan,
         Icon = ontology.Icon,
         IsEnabled = ontology.IsEnabled,
         IsLogicalDeletionEntity = ontology.IsLogicalDeletionEntity,
         IsCataloguedEntity = ontology.IsCataloguedEntity,
         IsSystem = ontology.IsSystem,
         MessageDatabaseId = ontology.MessageDatabaseId,
         MessageProviderId = ontology.MessageProviderId,
         MessageSchemaName = ontology.MessageSchemaName,
         Name = ontology.Name,
         ReceivedMessageBufferSize = ontology.ReceivedMessageBufferSize,
         ServiceIsAlive = ontology.ServiceIsAlive,
         SortCode = ontology.SortCode,
         Triggers = ontology.Triggers
     });
 }