1using System.Collections;
2using System.Collections.Generic;
3using System.Threading.Tasks;
12 private readonly LinkedList<ISemanticCube> sources =
new LinkedList<ISemanticCube>();
14 private int count = 0;
33 if (!(Source is
null))
35 if (this.first is
null)
38 this.sources.AddLast(Source);
50 if (!(Source is
null))
52 if (this.first is
null)
55 this.sources.AddLast(Source);
66 return this.CreateJoinedEnumerator();
73 IEnumerator IEnumerable.GetEnumerator()
75 return this.CreateJoinedEnumerator();
78 private IEnumerator<ISemanticTriple> CreateJoinedEnumerator()
80 LinkedList<IEnumerator<ISemanticTriple>> Enumerators =
new LinkedList<IEnumerator<ISemanticTriple>>();
82 foreach (ISemanticCube Source
in this.sources)
83 Enumerators.AddLast(Source.GetEnumerator());
85 return new JoinedTripleEnumerator(Enumerators,
true);
95 if (this.first is
null)
118 if (this.first is
null)
141 if (this.first is
null)
165 if (this.first is
null)
189 if (this.first is
null)
213 if (this.first is
null)
237 if (this.first is
null)
261 if (this.first is
null)
285 if (this.first is
null)
310 if (this.first is
null)
317 LinkedList<ISemanticTriple> Result =
new LinkedList<ISemanticTriple>();
326 Result.AddLast(Triple);
339 LinkedList<IEnumerator<ISemanticElement>> Enumerators =
new LinkedList<IEnumerator<ISemanticElement>>();
353 LinkedList<IEnumerator<ISemanticElement>> Enumerators =
new LinkedList<IEnumerator<ISemanticElement>>();
367 LinkedList<IEnumerator<ISemanticElement>> Enumerators =
new LinkedList<IEnumerator<ISemanticElement>>();
388 default:
return null;
403 if (Axis1Index == Axis2Index)
405 if (Value1.Equals(Value2))
406 return await this.
GetTriples(Value1, Axis1Index);
In-memory semantic plane.
Enumerator of elements from a collection of semantic data sources. The enumerator can remove duplicat...
async Task< ISemanticLine > GetTriplesBySubjectAndPredicate(ISemanticElement Subject, ISemanticElement Predicate)
Gets available triples in the cube, having a given subject and predicate.
async Task< IEnumerable< ISemanticTriple > > GetTriples(ISemanticElement Value1, int Axis1Index, ISemanticElement Value2, int Axis2Index)
Gets available triples in the cube, having two given values, along two given axes.
async Task< IEnumerable< ISemanticTriple > > GetTriples(ISemanticElement Value, int AxisIndex)
Gets available triples in the cube, having a given value, along a given axis.
async Task< ISemanticLine > GetTriplesByPredicateAndObject(ISemanticElement Predicate, ISemanticElement Object)
Gets available triples in the cube, having a given predicate and object.
async Task< ISemanticLine > GetTriplesBySubjectAndObject(ISemanticElement Subject, ISemanticElement Object)
Gets available triples in the cube, having a given subject and object.
async Task< ISemanticLine > GetTriplesByPredicateAndSubject(ISemanticElement Predicate, ISemanticElement Subject)
Gets available triples in the cube, having a given predicate and subject.
void Add(ISemanticCube Source)
Adds a source to the data set.
async Task< ISemanticLine > GetTriplesByObjectAndPredicate(ISemanticElement Object, ISemanticElement Predicate)
Gets available triples in the cube, having a given object and predicate.
async Task< IEnumerator< ISemanticElement > > GetPredicateEnumerator()
Gets an enumerator of all predicates.
async Task< ISemanticPlane > GetTriplesBySubject(ISemanticElement Subject)
Gets available triples in the cube, having a given subject.
async Task< ISemanticLine > GetTriplesByObjectAndSubject(ISemanticElement Object, ISemanticElement Subject)
Gets available triples in the cube, having a given object and subject.
async Task< ISemanticPlane > GetTriplesByPredicate(ISemanticElement Predicate)
Gets available triples in the cube, having a given predicate.
async Task< IEnumerator< ISemanticElement > > GetSubjectEnumerator()
Gets an enumerator of all subjects.
async Task< IEnumerable< ISemanticTriple > > GetTriplesBySubjectAndPredicateAndObject(ISemanticElement Subject, ISemanticElement Predicate, ISemanticElement Object)
Gets available triples in the cube, having a given subject, predicate and object.
IEnumerator< ISemanticTriple > GetEnumerator()
Gets an enumerator of available data sources.
SemanticDataSet(params ISemanticCube[] Sources)
In-memory semantic cube.
async Task< IEnumerator< ISemanticElement > > GetObjectEnumerator()
Gets an enumerator of all objects.
SemanticDataSet(IEnumerable< ISemanticCube > Sources)
In-memory semantic cube.
async Task< ISemanticPlane > GetTriplesByObject(ISemanticElement Object)
Gets available triples in the cube, having a given object.
Interface for semantic cubes.
Task< IEnumerator< ISemanticElement > > GetObjectEnumerator()
Gets an enumerator of all objects.
Task< ISemanticLine > GetTriplesByPredicateAndSubject(ISemanticElement Predicate, ISemanticElement Subject)
Gets available triples in the cube, having a given predicate and subject.
Task< IEnumerable< ISemanticTriple > > GetTriplesBySubjectAndPredicateAndObject(ISemanticElement Subject, ISemanticElement Predicate, ISemanticElement Object)
Gets available triples in the cube, having a given subject, predicate and object.
Task< ISemanticLine > GetTriplesBySubjectAndObject(ISemanticElement Subject, ISemanticElement Object)
Gets available triples in the cube, having a given subject and object.
Task< ISemanticLine > GetTriplesByObjectAndSubject(ISemanticElement Object, ISemanticElement Subject)
Gets available triples in the cube, having a given object and subject.
Task< ISemanticPlane > GetTriplesBySubject(ISemanticElement Subject)
Gets available triples in the cube, having a given subject.
Task< ISemanticLine > GetTriplesBySubjectAndPredicate(ISemanticElement Subject, ISemanticElement Predicate)
Gets available triples in the cube, having a given subject and predicate.
Task< IEnumerator< ISemanticElement > > GetPredicateEnumerator()
Gets an enumerator of all predicates.
Task< IEnumerator< ISemanticElement > > GetSubjectEnumerator()
Gets an enumerator of all subjects.
Task< ISemanticPlane > GetTriplesByPredicate(ISemanticElement Predicate)
Gets available triples in the cube, having a given predicate.
Task< ISemanticPlane > GetTriplesByObject(ISemanticElement Object)
Gets available triples in the cube, having a given object.
Task< ISemanticLine > GetTriplesByObjectAndPredicate(ISemanticElement Object, ISemanticElement Predicate)
Gets available triples in the cube, having a given object and predicate.
Task< ISemanticLine > GetTriplesByPredicateAndObject(ISemanticElement Predicate, ISemanticElement Object)
Gets available triples in the cube, having a given predicate and object.
Interface for semantic nodes.
Interface for semantic triples.