Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
MachineGraph.cs
1using System;
2using System.Threading.Tasks;
12
14{
19 {
23 public MachineGraph()
24 {
25 }
26
34 {
35 string BrokerPath = "/";
36 UriNode BrokerGraphUriNode = new UriNode(new Uri(Gateway.GetUrl(BrokerPath)));
37 int i, c;
38
39 Result.Add(BrokerGraphUriNode, Rdf.type, IoTConcentrator.Broker);
40
42
43 if (!string.IsNullOrEmpty(DomainConfiguration.Instance.HumanReadableName))
44 {
47 }
48
49 if ((c = (DomainConfiguration.Instance.LocalizedNames?.Length) ?? 0) > 0)
50 {
51 for (i = 0; i < c; i++)
52 {
53 Names.Add(new StringLiteral(
56 }
57 }
58
59 Result.AddContainer(BrokerGraphUriNode, Rdf.Alt, RdfSchema.label, Names);
60 Names.Clear();
61
62 if (!string.IsNullOrEmpty(DomainConfiguration.Instance.HumanReadableDescription))
63 {
64 Names.Add(new StringLiteral(
67 }
68
69 if ((c = (DomainConfiguration.Instance.LocalizedDescriptions?.Length) ?? 0) > 0)
70 {
71 for (i = 0; i < c; i++)
72 {
73 Names.Add(new StringLiteral(
76 }
77 }
78
79 Result.AddContainer(BrokerGraphUriNode, Rdf.Alt, RdfSchema.comment, Names);
80 Names.Clear();
81
83 {
85 {
86 DomainConfiguration.Instance.Domain
87 };
88
89 if ((DomainConfiguration.Instance.AlternativeDomains?.Length ?? 0) > 0)
91
92 Result.AddContainer(BrokerGraphUriNode, Rdf.Alt, IoTConcentrator.domain,
93 Domains.ToArray());
94 }
95
97
98 foreach (IDataSource RootSource in Gateway.ConcentratorServer.RootDataSources)
99 Items.Add(new UriNode(DataSourceGraph.GetSourceUri(RootSource.SourceID)));
100
101 Result.AddContainer(BrokerGraphUriNode, Rdf.Bag, IoTConcentrator.rootSources, Items);
102
103 return Task.CompletedTask;
104 }
105 }
106}
override void Add(ISemanticTriple Triple)
Adds a triple to the cube.
void AddContainer(ISemanticElement Subject, Uri Type, Uri Predicate, params object[] Items)
Adds a linked list of items to the graph.
static readonly Uri Alt
URI representing rdf:Alt, an unordered set of alternatives, where the first one is the default option...
Definition: Rdf.cs:102
static readonly Uri Bag
URI representing rdf:Bag, an unordered container.
Definition: Rdf.cs:96
static readonly Uri type
URI representing rdf:type
Definition: Rdf.cs:51
static readonly Uri comment
http://www.w3.org/2000/01/rdf-schema#comment
Definition: RdfSchema.cs:56
static readonly Uri label
http://www.w3.org/2000/01/rdf-schema#label
Definition: RdfSchema.cs:51
Static class managing the runtime environment of the IoT Gateway.
Definition: Gateway.cs:147
static string GetUrl(string LocalResource)
Gets a URL for a resource.
Definition: Gateway.cs:5079
static ConcentratorServer ConcentratorServer
XMPP Concentrator Server.
Definition: Gateway.cs:4053
string Value
Alternative field Value.
string Key
Alternative field name.
AlternativeField[] LocalizedDescriptions
Localized descriptions of domain
static DomainConfiguration Instance
Current instance of configuration.
string HumanReadableDescription
Human-readable description of domain
string HumanReadableDescriptionLanguage
Language of HumanReadableDescription.
string HumanReadableName
Human-readable name of domain
AlternativeField[] LocalizedNames
Localized names of domain
string[] AlternativeDomains
Alternative domain names
bool UseDomainName
If the server uses a domain name.
string HumanReadableNameLanguage
Language of HumanReadableName.
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
void AddRange(IEnumerable< T > Collection)
Adds a range of elements (last) to the list.
T[] ToArray()
Returns an array containing all elements of the collection.
Contains information about a language.
Definition: Language.cs:17
Tokens available in request.
Definition: RequestOrigin.cs:9
static readonly Uri rootSources
urn:nf:iot:concentrator:1.0:rootSources
static readonly Uri Broker
urn:nf:iot:concentrator:1.0:Broker
static readonly Uri domain
urn:nf:iot:concentrator:1.0:domains
Makes harmonized data sources and nodes available as semantic information.
static Uri GetSourceUri(string SourceID)
Gets the Graph URI for a data source.
Task GenerateGraph(InMemorySemanticCube Result, Language Language, RequestOrigin Caller)
Generates the semantic graph.
Definition: MachineGraph.cs:33
Interface for datasources that are published through the concentrator interface.
Definition: IDataSource.cs:14
string SourceID
ID of data source.
Definition: IDataSource.cs:19
Interface for dynamic graphs.