Exemple #1
0
 public Ontology(string location, string accessor, string label, IEnumerable <string> rootTypes, RdfSource source, RdfType type = RdfType.Unknown)
 {
     Location  = location;
     Accessor  = accessor;
     Label     = label;
     RdfSource = source;
     RdfType   = type;
     RootTypes = rootTypes;
 }
        /// <summary>
        /// Constructor of <see cref="Ontology"/>
        /// </summary>
        /// <param name="graphsUrl">Graphs url of the enviroment.</param>
        /// <param name="ontologyUrl">Download url of the ontology</param>
        /// <param name="rdfType">The <c>rdf:type</c> property of the ontology</param>
        /// <param name="rdfsLabel">the <c>rdfs:label</c> of the ontology</param>
        /// <param name="prefixList">Prefix list declared in the ontology</param>
        /// <param name="propertyList">Property list of the ontology</param>
        /// <param name="entityList">list of <see cref="OntologyEntity"> auxiliary entities</see></param>
        public Ontology(string graphsUrl, string ontologyUrl, string rdfType, string rdfsLabel, List <string> prefixList, List <OntologyProperty> propertyList, List <OntologyEntity> entityList = null)
            : base(graphsUrl, ontologyUrl, rdfType, rdfsLabel, prefixList, propertyList, entityList)
        {
            ResourceId = Guid.NewGuid();
            ArticleId  = Guid.NewGuid();

            if (RdfType != null && RdfType.Contains("#"))
            {
                _items = RdfType.Substring(RdfType.LastIndexOf("#") + 1);
            }
            else if (RdfType != null && RdfType.Contains("/"))
            {
                _items = RdfType.Substring(RdfType.LastIndexOf("/") + 1);
            }
            else
            {
                _items = RdfType;
            }

            Identifier = $"{GraphsUrl}items/{_items}_{ResourceId}_{ArticleId}";
        }