Exemple #1
0
        public void Merge(ResourceStatementCollection statements, ResourceMap map)
        {
            IEnumerator statementEnumerator = statements.GetStatementEnumerator();

            while (statementEnumerator.MoveNext())
            {
                ResourceStatement resStatement = (ResourceStatement)statementEnumerator.Current;
                Node      theSubject           = (Node)map.GetBestDenotingNode(resStatement.GetSubject());
                Arc       thePredicate         = (Arc)map.GetBestDenotingNode(resStatement.GetPredicate());
                Node      theObject            = (Node)map.GetBestDenotingNode(resStatement.GetObject());
                Statement statement            = new Statement(theSubject, thePredicate, theObject);
                Add(statement);
            }
        }
Exemple #2
0
 public virtual Bindings Unify(Atom other, Bindings bindings, ResourceMap map)
 {
     if (bindings.Contains(this))
     {
         return(((Atom)bindings.Get(this)).Unify(other, bindings, map));
     }
     else if (bindings.Contains(other))
     {
         return(Unify((Atom)bindings.Get(other), bindings, map));
     }
     //~ else if ( VariableOccursInExpression( var, other) ) {
     //~ return null;
     //~ }
     else
     {
         Bindings cloned = (Bindings)bindings.Clone();
         cloned.Bind(this, other);
         if (other is Resource)
         {
             cloned.BindNode(this, map.GetBestDenotingNode((Resource)other));
         }
         return(cloned);
     }
 }