Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ComplementPattern.cs
1using System.Collections.Generic;
2using System.Text;
3using System.Threading.Tasks;
5
7{
12 {
19 : base(Left, Right)
20 {
21 }
22
31 public override async Task<IEnumerable<Possibility>> Search(ISemanticCube Cube, Variables Variables,
32 IEnumerable<Possibility> ExistingMatches, SparqlQuery Query)
33 {
34 ExistingMatches = await this.Left.Search(Cube, Variables, ExistingMatches, Query);
35 if (ExistingMatches is null)
36 return null;
37
38 LinkedList<Possibility> Result = null;
39
40 foreach (Possibility P in ExistingMatches)
41 {
42 IEnumerable<Possibility> NewMatches = await this.Right.Search(Cube, Variables,
43 new Possibility[] { P }, Query);
44
45 if (NewMatches is null || !NewMatches.GetEnumerator().MoveNext())
46 {
47 if (Result is null)
48 Result = new LinkedList<Possibility>();
49
50 Result.AddLast(P);
51 }
52 }
53
54 return Result;
55 }
56
57 }
58}
Complement of a pattern (right) in another (left).
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.
ComplementPattern(ISparqlPattern Left, ISparqlPattern Right)
Complement of a pattern (right) in another (left).
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.