Package org.openrdf.model.impl

Examples of org.openrdf.model.impl.LinkedHashModel


      context = vf.createBNode();
    }

    con.add(context, RDF.TYPE, REPOSITORY_CONTEXT);

    Model model = new LinkedHashModel();
    config.export(model);
    con.add(model, context);

    con.commit();
  }
View Full Code Here


  {
    for (Value value : config.filter(null, REPOSITORYID, null).objects()) {
      removeConfig(value.stringValue());
    }
   
    Model model = new LinkedHashModel();
    Resource context = vf.createBNode(id);
    model.add(context, RDF.TYPE, REPOSITORY_CONTEXT);
    model.add(context, REPOSITORYID, new LiteralImpl(id), context);
    for (Statement st : config) {
      model.add(st.getSubject(), st.getPredicate(), st.getObject(), context);
    }

    addSystemModel(model);
  }
View Full Code Here

  public void updateConfig(String id, Model config)
    throws StoreConfigException
  {

    Model model = new LinkedHashModel();
    Resource context = vf.createBNode(id);
    model.add(context, RDF.TYPE, REPOSITORY_CONTEXT);
    model.add(context, REPOSITORYID, new LiteralImpl(id), context);
    model.filter(null, null, null, context).addAll(config);

    addSystemModel(model);
  }
View Full Code Here

  {
    Repository system = getSystemRepository();
    try {
      RepositoryConnection con = system.getConnection();
      try {
        return con.match(null, null, null, false).addTo(new LinkedHashModel());
      }
      finally {
        con.close();
      }
    }
View Full Code Here

    return properties;
  }

  public Model createConfig(List<ConfigProperty> properties) {
    int idx = 0;
    Model model = new LinkedHashModel();
    model.getNamespaces().putAll(statements.getNamespaces());
    for (Statement st : statements) {
      Resource subj = st.getSubject();
      URI pred = st.getPredicate();
      if (schema.contains(pred, null, null) && properties != null) {
        if (!properties.get(idx).getPredicate().equals(pred)) {
          throw new IllegalArgumentException("Invalid properties");
        }
        model.add(subj, pred, properties.get(idx++).getValue());
      }
      else {
        model.add(subj, pred, st.getObject());
      }
    }
    return model;
  }
View Full Code Here

  {
    try {
      RDFFormat format = Rio.getParserFormatForFileName(file.getName());
      RDFParser parser = Rio.createParser(format);

      Model model = new LinkedHashModel();
      parser.setRDFHandler(new StatementCollector(model));

      InputStream stream = new FileInputStream(file);
      try {
        parser.parse(stream, file.toURI().toString());
View Full Code Here

    }
    implConfig.validate();
  }

  public Model export() {
    Model model = new LinkedHashModel();
    export(model);
    return model;
  }
View Full Code Here

  }

  public static Model toGraph(TupleResult tqr)
    throws StoreException
  {
    Model model = new LinkedHashModel();
    DAWGTestResultSetWriter writer = new DAWGTestResultSetWriter(new StatementCollector(model));

    try {
      writer.startQueryResult(tqr.getBindingNames());
      while (tqr.hasNext()) {
View Full Code Here

    testCon.add(alice, name, nameAlice);

    Model model;
    ModelResult statements = testCon.match(null, null, null, true);
    try {
      model = new LinkedHashModel(statements.asList());
    }
    finally {
      statements.close();
    }
View Full Code Here

    RDFFormat rdfFormat = Rio.getParserFormatForMIMEType(mimeType);

    try {
      RDFParser parser = Rio.createParser(rdfFormat);

      Model model = new LinkedHashModel();
      parser.setRDFHandler(new StatementCollector(model));

      parser.parse(entity.getStream(), "");

      return model;
View Full Code Here

TOP

Related Classes of org.openrdf.model.impl.LinkedHashModel

Copyright © 2018 www.massapicom. 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.