예제 #1
0
 public Model add(Statement[] sarr)
 {
     foreach (Statement stmt in sarr)
     {
         this._g.Assert(JenaConverter.FromJena(stmt, this._mapping));
     }
     return(this);
 }
예제 #2
0
        public Model add(Model m)
        {
            Graph h = new Graph();

            JenaConverter.FromJena(m, h);
            this._g.Merge(h);
            return(this);
        }
예제 #3
0
 public Model add(StmtIterator si)
 {
     while (si.hasNext())
     {
         Statement stmt = si.nextStatement();
         this._g.Assert(JenaConverter.FromJena(stmt, this._mapping));
     }
     return(this);
 }
예제 #4
0
        public Model add(Model m, bool b)
        {
            Graph h = new Graph();

            JenaConverter.FromJena(m, h);
            if (b)
            {
                //TODO: Suppress reification triples
            }
            this._g.Merge(h);
            return(this);
        }
예제 #5
0
 private IEnumerable <Triple> GetTriples(Resource r, Property p, RDFNode rdfn)
 {
     if (r == null)
     {
         if (p == null)
         {
             //Object specified
             return(this._g.GetTriplesWithObject(JenaConverter.FromJenaNode(rdfn, this._mapping)));
         }
         else if (rdfn == null)
         {
             //Predicate specified
             return(this._g.GetTriplesWithPredicate(JenaConverter.FromJenaProperty(p, this._mapping)));
         }
         else
         {
             //Object and Predicate specified
             return(this._g.GetTriplesWithPredicateObject(JenaConverter.FromJenaProperty(p, this._mapping), JenaConverter.FromJenaNode(rdfn, this._mapping)));
         }
     }
     else if (p == null)
     {
         if (rdfn == null)
         {
             //Subject specified
             return(this._g.GetTriplesWithSubject(JenaConverter.FromJenaResource(r, this._mapping)));
         }
         else
         {
             //Subject and Object specified
             return(this._g.GetTriplesWithSubjectObject(JenaConverter.FromJenaResource(r, this._mapping), JenaConverter.FromJenaNode(rdfn, this._mapping)));
         }
     }
     else if (rdfn == null)
     {
         //Subject and Predicate specified
         return(this._g.GetTriplesWithSubjectPredicate(JenaConverter.FromJenaResource(r, this._mapping), JenaConverter.FromJenaProperty(p, this._mapping)));
     }
     else
     {
         Triple t = new Triple(JenaConverter.FromJenaResource(r, this._mapping), JenaConverter.FromJenaProperty(p, this._mapping), JenaConverter.FromJenaNode(rdfn, this._mapping));
         if (this._g.ContainsTriple(t))
         {
             return(t.AsEnumerable());
         }
         else
         {
             return(Enumerable.Empty <Triple>());
         }
     }
 }
예제 #6
0
        public Model add(List l)
        {
            ListIterator iter = l.listIterator();

            while (iter.hasNext())
            {
                Object obj = iter.next();
                if (obj is Statement)
                {
                    this._g.Assert(JenaConverter.FromJena((Statement)obj, this._mapping));
                }
            }
            return(this);
        }
예제 #7
0
 protected override void Delete(Triple t)
 {
     this._m.remove(JenaConverter.ToJena(t, this._mapping));
 }
예제 #8
0
 public override bool Contains(Triple t)
 {
     return(this._m.contains(JenaConverter.ToJena(t, this._mapping)));
 }
예제 #9
0
 protected override void Add(Triple t)
 {
     this._m.add(JenaConverter.ToJena(t, this._mapping));
 }
예제 #10
0
 public bool contains(Resource r, Property p)
 {
     return(this._g.GetTriplesWithSubjectPredicate(JenaConverter.FromJenaResource(r, this._mapping), JenaConverter.FromJenaProperty(p, this._mapping)).Any());
 }
예제 #11
0
 public bool contains(Statement s)
 {
     return(this._g.ContainsTriple(JenaConverter.FromJena(s, this._mapping)));
 }
예제 #12
0
 public Model add(Statement s)
 {
     this._g.Assert(JenaConverter.FromJena(s, this._mapping));
     return(this);
 }