コード例 #1
0
        public void Extend(Entity e)
        {
            var dp = e.GetDatapoint();

            RDFGraph.Assert(new Triple(un, RDF_TYPE, LDP_BASIC_CONTAINER));
            RDFGraph.Assert(new Triple(un, RDFGraph.CreateUriNode("ldp:contains"), RDFGraph.CreateUriNode(new Uri(e.GetDatapoint().Route))));
        }
コード例 #2
0
ファイル: EntityLDPGraph.cs プロジェクト: tospie/eca2ld
 private void addComponentNodes()
 {
     foreach (Component c in e.Components)
     {
         var componentUri = new Uri(dp_uri.TrimEnd('/') + "/" + c.Name + "/");
         RDFGraph.Assert(new Triple(un, DCT_HAS_PART, RDFGraph.CreateUriNode(componentUri)));
     }
 }
コード例 #3
0
 public void AddExternalEntity(string externalUri)
 {
     RDFGraph.NamespaceMap.AddNamespace("foaf", new Uri("http://xmlns.com/foaf/0.1/"));
     RDFGraph.Assert(new Triple(un,
                                RDFGraph.CreateUriNode("foaf:knows"),
                                RDFGraph.CreateUriNode(new Uri(externalUri))
                                ));
 }
コード例 #4
0
 private void CreateAttributeTriples()
 {
     foreach (AttributePrototype a in c.Prototype.AttributePrototypes)
     {
         string attributeUri = dp_uri.TrimEnd('/') + "/" + a.Name;
         RDFGraph.Assert(new Triple(un, DCT_HAS_PART, RDFGraph.CreateUriNode(new Uri(attributeUri))));
     }
 }
コード例 #5
0
        private void buildRDFBaseGraph()
        {
            RDFGraph.Assert(new Triple(un, RDF_TYPE, LDP_RDF_RESOURCE));
            RDFGraph.Assert(new Triple(un, DCT_IDENTIFIER, RDFGraph.CreateLiteralNode(attribute.Prototype.Name, new Uri("xsd:string"))));

            string compUri = dp_uri.Replace("/" + attribute.Prototype.Name, "");

            RDFGraph.Assert(new Triple(un, DCT_IS_PART_OF, RDFGraph.CreateUriNode(new Uri(compUri))));
        }
コード例 #6
0
        protected override void BuildRDFGraph()
        {
            RDFGraph.Assert(new Triple(un, RDF_TYPE, LDP_RDF_RESOURCE));
            RDFGraph.Assert(new Triple(un, DCT_IDENTIFIER, RDFGraph.CreateLiteralNode(attribute.Prototype.Name, "xsd:string")));

            string compUri = dp_uri.Replace("/" + attribute.Prototype.Name, "");

            RDFGraph.Assert(new Triple(un, DCT_IS_PART_OF, RDFGraph.CreateUriNode(new Uri(compUri))));
            string valuestring = attribute?.Value?.ToString() ?? "null";

            RDFGraph.Assert(new Triple(un, RDF_VALUE, RDFGraph.CreateLiteralNode(valuestring, attribute.Type.transformTypeToString())));
        }
コード例 #7
0
        protected override void BuildRDFGraph()
        {
            RDFGraph.Assert(new Triple(un, RDF_TYPE, LDP_BASIC_CONTAINER));
            RDFGraph.Assert(new Triple(un, DCT_IDENTIFIER, n_c));
            RDFGraph.Assert(new Triple(un, DCT_IS_PART_OF, GetContainingEntityURI()));
            RDFGraph.Assert(new Triple(un, LDP_HASMEMBERRELATION, DCT_HAS_PART));

            var definedByUri = new Uri(u.getPrototypeBaseUri() + c.Name + "/");

            RDFGraph.Assert(new Triple(un, RDFS_IS_DEFINED_BY, RDFGraph.CreateUriNode(definedByUri)));

            CreateAttributeTriples();
        }
コード例 #8
0
 public ComponentPrototypeGraph(Uri u, ReadOnlyComponentPrototype p) : base(u)
 {
     componentPrototype = p;
     RDFGraph.NamespaceMap.AddNamespace("eca", new Uri("http://www.dfki.de/eca#"));
     ECA_COMPONENT   = RDFGraph.CreateUriNode("eca:component");
     attributesGraph = new Graph();
     attributesGraph.NamespaceMap.AddNamespace("rdf", new Uri("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
     attributesGraph.NamespaceMap.AddNamespace("ldp", new Uri("http://www.w3.org/ns/ldp#"));
     attributesGraph.NamespaceMap.AddNamespace("dct", new Uri("http://purl.org/dc/terms/"));
     attributesGraph.NamespaceMap.AddNamespace("rdfs", new Uri("http://www.w3.org/2000/01/rdf-schema#"));
     attributesGraph.NamespaceMap.AddNamespace("eca", new Uri("http://www.dfki.de/eca#"));
     createAttributePrototypesGraph();
     BuildRDFGraph();
     RDFGraph.Merge(attributesGraph, false);
 }
コード例 #9
0
        public Graph getMergedGraph()
        {
            Graph mergedGraph = RDFGraph.CopyGraph();

            mergedGraph.Assert(new Triple(un, RDF_VALUE, RDFGraph.CreateLiteralNode(attribute.Value.ToString(), new Uri("xsd:attributeValue"))));
            if (attribute.Type.Equals(typeof(EntityCollection)))
            {
                foreach (Entity e in (EntityCollection)attribute.Value)
                {
                    mergedGraph.Assert(new Triple(un,
                                                  RDFGraph.CreateUriNode("ldp:contains"),
                                                  RDFGraph.CreateUriNode(new Uri(e.GetDatapoint().Route))
                                                  ));
                }
            }
            return(mergedGraph);
        }
コード例 #10
0
ファイル: EntityLDPGraph.cs プロジェクト: tospie/eca2ld
 public void AddComponentTriple(string componentUri)
 {
     RDFGraph.Assert(new Triple(un, DCT_HAS_PART, RDFGraph.CreateUriNode(new Uri(componentUri))));
 }
コード例 #11
0
 protected override void BuildRDFGraph()
 {
     buildRDFBaseGraph();
     RDFGraph.Assert(new Triple(un, RDF_VALUE, RDFGraph.CreateUriNode(new Uri(dp_uri + "/value/"))));
 }
コード例 #12
0
 public void AddTypeRoute(string typeRoute)
 {
     RDFGraph.Assert(new Triple(un, RDF_TYPE, RDFGraph.CreateUriNode(new Uri(typeRoute))));
 }
コード例 #13
0
 public AttributeLDPGraph(Uri u, ECABaseModel.Attribute a, string EntityUri) : base(u)
 {
     attribute = a;
     buildRDFBaseGraph();
     RDFGraph.Assert(new Triple(un, RDF_VALUE, RDFGraph.CreateUriNode(new Uri(EntityUri))));
 }
コード例 #14
0
 public void AddExternalContainer(string externalUri)
 {
     RDFGraph.Assert(new Triple(un,
                                RDFGraph.CreateUriNode("rdfs:seeAlso"),
                                RDFGraph.CreateUriNode(new Uri(externalUri))));
 }
コード例 #15
0
        private IUriNode GetContainingEntityURI()
        {
            string entityUri = dp_uri.Replace("/" + c.Name, "");

            return(RDFGraph.CreateUriNode(new Uri(entityUri)));
        }
コード例 #16
0
 public void AddAttributeTriple(string attributeUri)
 {
     RDFGraph.Assert(new Triple(un, DCT_HAS_PART, RDFGraph.CreateUriNode(new Uri(attributeUri))));
 }