public void ReadXml(XmlReader reader) { switch (reader.GetAttribute("graph")) { case "variable": this.variableDataSet = new VariableDataSet(); this.variableDataSet.ReadXml(reader); this.isDefaultGraph = false; break; case "named": this.graphs = new DataSet(); this.graphs.ReadXml(reader); this.isDefaultGraph = false; break; case "default": this.isDefaultGraph = true; break; default: throw new Exception(); } this.Subject = (ObjectVariants)Query.SparqlQuery.CreateByTypeAttribute(reader); this.Predicate = (ObjectVariants)Query.SparqlQuery.CreateByTypeAttribute(reader); this.Object = (ObjectVariants)Query.SparqlQuery.CreateByTypeAttribute(reader); this.sVariableNode = Subject as VariableNode; this.pVariableNode = Predicate as VariableNode; this.oVariableNode = Object as VariableNode; }
public SparqlTriple(ObjectVariants subj, ObjectVariants pred, ObjectVariants obj, RdfQuery11Translator q) { Subject = subj; Predicate = pred; Object = obj; //if(!(subj is ObjectVariants)) throw new ArgumentException(); graphs = q.ActiveGraphs; //this.Graph = graph; sVariableNode = subj as VariableNode; pVariableNode = pred as VariableNode; oVariableNode = obj as VariableNode; variableDataSet = (q.ActiveGraphs as VariableDataSet); isDefaultGraph = variableDataSet == null && graphs.Count == 0; store = q.Store; }
public SparqlTriple(ObjectVariants subj, ObjectVariants pred, ObjectVariants obj, RdfQuery11Translator q) { this.Subject = subj; this.Predicate = pred; this.Object = obj; // if(!(subj is ObjectVariants)) throw new ArgumentException(); this.graphs = q.ActiveGraphs; // this.Graph = graph; this.sVariableNode = subj as VariableNode; this.pVariableNode = pred as VariableNode; this.oVariableNode = obj as VariableNode; this.variableDataSet = q.ActiveGraphs as VariableDataSet; this.isDefaultGraph = this.variableDataSet == null && this.graphs.Count == 0; this.store = q.Store; }