コード例 #1
0
 public ComponentLDPGraph(Uri u, Component c) : base(u)
 {
     this.c = c;
     this.u = u;
     n_c    = RDFGraph.CreateLiteralNode(c.Name, new Uri("xsd:string"));
     BuildRDFGraph();
 }
コード例 #2
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))));
        }
コード例 #3
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())));
        }
コード例 #4
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);
        }
コード例 #5
0
ファイル: EntityLDPGraph.cs プロジェクト: tospie/eca2ld
 public EntityLDPGraph(Uri u, Entity e) : base(u)
 {
     this.e = e;
     n_e    = RDFGraph.CreateLiteralNode(e.Guid.ToString(), new Uri("xsd:string"));
     BuildRDFGraph();
 }