- All Implemented Interfaces:
- IViewDef
public class ViewDefinition
extends Object
implements IViewDef
A view definition is comprised of
- A name
- A template (a set of quad patterns)
- A mapping
- A set of references to variables declared in other view definitions.
Here are some notes on the references:
Create View view_person {
?s a Person
}
With
?s = uri(name) [prefixes = {ns1, ns2}]
From
people_table;
Create View employee_to_dept As Construct {
?p :worksIn ?d
}
References
ppl: view_person On this.person_id = that.id
depts: ... // Reference to the dept view on some join condition
With
?p = ref(ppl, ?s) // Syntactic sugar for the following line:
?p_resolved = uri(ppl.name) [prefixes=...] // We now have a qualified column reference and the constraints carry over
?d = ref(depts, ?s)
From
p2d_table;
Issue: (Q = Question, T = thought, R = resolution)
- Q: Nested refs: How to treat cases where a view V hase a ref(refName, ?var) which refers to another ref, e.g. ?x = ref(someRef.someNestedRef, ?x)
T: Essentielly it should work somehow like this: for any view instance of V, we would keep track of a (list of) unresolved references; the nested ones would be
simply added.
When creating view instances, we now have to keep track of which refereences have been resolved.
If a variable is not bound in a varbinding, then its references do not need to be resolved.
Conversely: Each bound view variable's references are added to the view instance's list of unresolved references.
Also, for each view instance variable we need to deal with the qualified column names.
Not sure where to deal with them best.
Initially unresolved refs for the employee_to_dept view are ppl and depts.
- Author:
- Claus Stadler