public override void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } graph.Assert(RdfHelpers.CreateTriple( RdfNS.SALModel, Name, RdfNS.RDFUri, "type", RdfNS.BrickUri, "Room" )); graph.Assert(RdfHelpers.CreateTriple( parent, predicate, RdfNS.SALModel, Name )); }
public virtual void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } //Defining type of this object graph.Assert(RdfHelpers.CreateTriple( RdfNS.SALModel, Name, RdfNS.RDFUri, "type", RdfNS.BrickUri, "Location" )); //Define relationship to parent graph.Assert(RdfHelpers.CreateTriple( parent, predicate, RdfNS.SALModel, Name )); }
public void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } graph.Assert(RdfHelpers.CreateTriple( RdfNS.SALModel, "organization_sdu", RdfNS.RDFUri, "type", RdfNS.SchemaOrgUri, "Organization" )); graph.Assert(RdfHelpers.CreateTriple( RdfNS.SALModel, "organization_sdu", RdfNS.SchemaOrgUri, "legalName", this.LegalName )); graph.Assert(RdfHelpers.CreateTriple( parent, predicate, RdfNS.SALModel, "organization_sdu" )); }
public override void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } string name = IdGenerator.NewId("RestServiceEndpoint"); var thisNode = RdfHelpers.CreateEntity(RdfNS.SALModel, name); //Defining type of this object graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.RDFUri, "type", RdfNS.SALUri, "RestServiceEndpoint" )); //Define relationship to parent graph.Assert(RdfHelpers.CreateTriple( parent, predicate, thisNode )); //run superclass stuff. base.AddTriplesFromSubClass(graph, parent, thisNode); //Set Data property url graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "url", this.Url )); //set object property TemporalAspect graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "verb", RdfNS.SALIUri, Enum.GetName(typeof(HTTPVerb), this.Verb).ToUpper() )); foreach (var item in this.ConsumesInformation) { item.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "consumesInformation")); } foreach (var item in this.ProvidesInformation) { item.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "providesInformation")); } }
public void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } string name = IdGenerator.NewId("Information"); var thisNode = RdfHelpers.CreateEntity(RdfNS.SALModel, name); //Defining type of this object graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.RDFUri, "type", RdfNS.SALUri, "Information" )); //Define relationship to parent graph.Assert(RdfHelpers.CreateTriple( parent, predicate, thisNode )); //Set Data property location graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "location", this.Location )); //set object property Unit graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "hasUnit", RdfNS.SALIUri, Enum.GetName(typeof(Unit), this.HasUnit) )); //set object property Modality graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "hasModality", RdfNS.SALIUri, Enum.GetName(typeof(Modality), this.HasModality) )); //set object property TemporalAspect graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "hasTemporalAspect", RdfNS.SALIUri, Enum.GetName(typeof(TemporalAspect), this.HasTemporalAspect) )); this.HasLocation?.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "hasLocation")); }
public override void AddTriples(IGraph graph, INode parent, INode predicate) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (predicate == null) { throw new ArgumentNullException(nameof(predicate)); } string name = IdGenerator.NewId("KafkaRWServiceEndpoint"); var thisNode = RdfHelpers.CreateEntity(RdfNS.SALModel, name); //Defining type of this object graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.RDFUri, "type", RdfNS.SALUri, "KafkaRWServiceEndpoint" )); //Define relationship to parent graph.Assert(RdfHelpers.CreateTriple( parent, predicate, thisNode )); //run superclass stuff. base.AddTriplesFromSubClass(graph, parent, thisNode); //Set Data property read_topic graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "read_topic", this.ReadTopic )); //Set Data property write_topic graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "write_topic", this.WriteTopic )); foreach (var item in this.ConsumesInformation) { item.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "consumesInformation")); } foreach (var item in this.ProvidesInformation) { item.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "providesInformation")); } }
public IGraph GenerateGraph() { IGraph graph = new Graph().AddStandardSALNamespaces(); RdfHelpers.Graph = graph; var thisNode = RdfHelpers.CreateEntity(RdfNS.SALModel, IdGenerator.NewId("Service")); //Defining type of this object graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.RDFUri, "type", RdfNS.SALUri, "Service" )); //Set Data property location graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "name", this.Name )); if (this.HasServiceEndpoint != null) { foreach (var serviceEndpoint in this.HasServiceEndpoint.FindAll(m => m is KafkaRServiceEndpoint).ToList()) { serviceEndpoint.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "hasKafkaRServiceEndpoint")); } foreach (var serviceEndpoint in this.HasServiceEndpoint.FindAll(m => m is KafkaWServiceEndpoint).ToList()) { serviceEndpoint.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "hasKafkaWServiceEndpoint")); } foreach (var serviceEndpoint in this.HasServiceEndpoint.FindAll(m => m is KafkaRWServiceEndpoint).ToList()) { serviceEndpoint.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "hasKafkaRWServiceEndpoint")); } foreach (var serviceEndpoint in this.HasServiceEndpoint.FindAll(m => m is RestServiceEndpoint).ToList()) { serviceEndpoint.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "hasRestServiceEndpoint")); } } return(graph); }
protected virtual void AddTriplesFromSubClass(IGraph graph, INode parent, INode thisNode) { if (graph == null) { throw new ArgumentNullException(nameof(graph)); } if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (thisNode == null) { throw new ArgumentNullException(nameof(thisNode)); } this.OwnedBy.AddTriples(graph, thisNode, RdfHelpers.CreateEntity(RdfNS.SALUri, "ownedBy")); //set object property Priority graph.Assert(RdfHelpers.CreateTriple( thisNode, RdfNS.SALUri, "priority", this.Priority.ToString() )); }