Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OptionalPattern.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4
6{
11 {
18 : base(Left, Right)
19 {
20 }
21
30 public override async Task<IEnumerable<Possibility>> Search(ISemanticCube Cube,
31 Variables Variables, IEnumerable<Possibility> ExistingMatches, SparqlQuery Query)
32 {
33 ExistingMatches = await this.Left.Search(Cube, Variables, ExistingMatches, Query);
34 if (ExistingMatches is null)
35 return null;
36
37 LinkedList<Possibility> NewMatches2 = new LinkedList<Possibility>();
38
39 foreach (Possibility P in ExistingMatches)
40 {
41 IEnumerable<Possibility> NewMatches = await this.Right.Search(Cube, Variables,
42 new Possibility[] { P }, Query);
43
44 if (NewMatches is null)
45 NewMatches2.AddLast(P);
46 else
47 {
48 foreach (Possibility P2 in NewMatches)
49 NewMatches2.AddLast(P2);
50 }
51 }
52
53 return NewMatches2;
54 }
55 }
56}
OptionalPattern(ISparqlPattern Left, ISparqlPattern Right)
Optional pattern.
override async Task< IEnumerable< Possibility > > Search(ISemanticCube Cube, Variables Variables, IEnumerable< Possibility > ExistingMatches, SparqlQuery Query)
Searches for the pattern on information in a semantic cube.
Represents a possible solution during SPARQL evaluation.
Definition: Possibility.cs:13
Collection of variables.
Definition: Variables.cs:25
Interface for semantic cubes.
Task< IEnumerable< Possibility > > Search(ISemanticCube Cube, Variables Variables, IEnumerable< Possibility > ExistingMatches, SparqlQuery Query)
Searches for the pattern on information in a semantic cube.