Package org.ontoware.rdf2go.model

Examples of org.ontoware.rdf2go.model.Model.addStatement()


    while(it.hasNext()) {
      Statement s = it.next();
      if(s.getObject() instanceof LanguageTagLiteral) {
        LanguageTagLiteral lit = s.getObject().asLanguageTagLiteral();
        if(lit.getLanguageTag().startsWith(language)) {
          result.addStatement(s);
        }
        // else don't copy
      } else {
        result.addStatement(s);
      }
View Full Code Here


        if(lit.getLanguageTag().startsWith(language)) {
          result.addStatement(s);
        }
        // else don't copy
      } else {
        result.addStatement(s);
      }
    }
    it.close();
    return result;
  }
View Full Code Here

        Transformer.toSparqlConstruct(namespaceMap, remove, search))
        .iterator();
    while (it.hasNext()) {
      Statement stmt = it.next();
      log.trace("rule removes "+stmt);
      removeModel.addStatement(stmt);
    }
    it.close();

    log.trace("rule remove... ");
    Model addModel = RDF2Go.getModelFactory().createModel();
View Full Code Here

        Transformer.toSparqlConstruct(namespaceMap, add, search))
        .iterator();
    while (it.hasNext()) {
      Statement stmt = it.next();
      log.trace("rule adds    "+stmt);
      addModel.addStatement(stmt);
    }
    it.close();

    DiffReader diff = new DiffImpl(addModel.iterator(), removeModel.iterator());
    addModel.close();
View Full Code Here

    ClosableIterator<Statement> it = model.sparqlConstruct(query)
        .iterator();
    while (it.hasNext()) {
      Statement stmt = it.next();
      log.trace("rule infers    "+stmt);
      addModel.addStatement(stmt);
    }
    it.close();

    DiffReader diff = new DiffImpl(addModel.iterator(), removeModel.iterator());
    addModel.close();
View Full Code Here

                    // happens on unencoded file names! so just ignore it and leave the file name as it is
                }
                URI attachURI = URIGenerator.createNewRandomUniqueURI();
                rdf.add(NMO.hasAttachment, attachURI);
                Model m = rdf.getModel();
                m.addStatement(attachURI, RDF.type, NFO.Attachment);
                m.addStatement(attachURI, NFO.fileName, fileName);
                if (handler != null) {
                    if (encoding != null) {
                        m.addStatement(attachURI, NFO.encoding, encoding);
                    }
View Full Code Here

                }
                URI attachURI = URIGenerator.createNewRandomUniqueURI();
                rdf.add(NMO.hasAttachment, attachURI);
                Model m = rdf.getModel();
                m.addStatement(attachURI, RDF.type, NFO.Attachment);
                m.addStatement(attachURI, NFO.fileName, fileName);
                if (handler != null) {
                    if (encoding != null) {
                        m.addStatement(attachURI, NFO.encoding, encoding);
                    }
                }
View Full Code Here

                Model m = rdf.getModel();
                m.addStatement(attachURI, RDF.type, NFO.Attachment);
                m.addStatement(attachURI, NFO.fileName, fileName);
                if (handler != null) {
                    if (encoding != null) {
                        m.addStatement(attachURI, NFO.encoding, encoding);
                    }
                }
                if (contentType != null) {
                    contentType = (new ContentType(contentType)).getBaseType();
                    m.addStatement(attachURI, NIE.mimeType, contentType.trim());
View Full Code Here

                        m.addStatement(attachURI, NFO.encoding, encoding);
                    }
                }
                if (contentType != null) {
                    contentType = (new ContentType(contentType)).getBaseType();
                    m.addStatement(attachURI, NIE.mimeType, contentType.trim());
                }
                // TODO: encoding?
            }
           
            // append the content, if any
View Full Code Here

                    nodeMap.put(obj.asBlankNode(), newObj);
                }
                obj = newObj;
            }
            if (match) {
                remove.addStatement(stmt);
                add.addStatement(subj, pred, obj);
            }
        }
        ClosableIterator<Statement> addIt = add.iterator();
        ClosableIterator<Statement> removeIt = remove.iterator();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.