Ejemplo n.º 1
0
 public bool add(object obj)
 {
     if (obj is dotSesame.Statement)
     {
         dotSesame.Statement stmt = (dotSesame.Statement)obj;
         Triple t = SesameConverter.FromSesame(stmt, this._mapping);
         if (this._g.ContainsTriple(t))
         {
             return(false);
         }
         else
         {
             this._g.Assert(t);
             return(true);
         }
     }
     else if (obj is Triple)
     {
         Triple t = (Triple)obj;
         if (this._g.ContainsTriple(t))
         {
             return(false);
         }
         else
         {
             this._g.Assert(t);
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        public virtual void add(org.openrdf.model.Statement s, params org.openrdf.model.Resource[] rarr)
        {
            IEnumerable <Uri> contexts = rarr.ToContexts(this._mapping);
            Graph             g        = new Graph();

            g.Assert(SesameConverter.FromSesame(s, this._mapping));
            this.AddInternal(g, contexts);
        }
Ejemplo n.º 3
0
        public override void remove(org.openrdf.model.Statement s, params org.openrdf.model.Resource[] rarr)
        {
            if (this._manager.IsReadOnly)
            {
                throw NotWritableError("remove");
            }

            base.remove(s, rarr);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Converts a Sesame Graph to a dotNetRDF Graph
        /// </summary>
        /// <param name="source">Sesame Graph</param>
        /// <param name="mapping">Blank Node Mapping</param>
        /// <param name="target">dotNetRDF Graph</param>
        public static void FromSesame(dotSesame.Graph source, SesameMapping mapping, IGraph target)
        {
            Iterator iter = source.iterator();

            while (iter.hasNext())
            {
                dotSesame.Statement stmt = (dotSesame.Statement)iter.next();
                target.Assert(FromSesame(stmt, mapping));
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Converts a Sesame Statement to a dotNetRDF Triple
 /// </summary>
 /// <param name="statement">Sesame Statement</param>
 /// <param name="mapping">Blank Node Mapping</param>
 /// <returns></returns>
 public static Triple FromSesame(dotSesame.Statement statement, SesameMapping mapping)
 {
     return(new Triple(FromSesameResource(statement.getSubject(), mapping), FromSesameUri(statement.getPredicate(), mapping), FromSesameValue(statement.getObject(), mapping)));
 }
Ejemplo n.º 6
0
        public bool hasStatement(org.openrdf.model.Statement s, bool b, params org.openrdf.model.Resource[] rarr)
        {
            Triple t = SesameConverter.FromSesame(s, this._mapping);

            return(HasTripleInternal(t));
        }