Package org.openrdf.model

Examples of org.openrdf.model.Model


  }

  public Model readModel()
    throws IOException, RDFParseException, NoCompatibleMediaType
  {
    Model model = new LinkedHashModel();
    try {
      readRDF(new StatementCollector(model));
    }
    catch (RDFHandlerException e) {
      throw new AssertionError(e);
View Full Code Here


        if (value.length() > 0) {
          property.setValue(new LiteralImpl(value));
        }
      }

      Model repConfig = configTemplate.createConfig(properties);

      if (manager.hasRepositoryConfig(repositoryID)) {
        boolean proceed = askProceed(
            "WARNING: you are about to overwrite the configuration of an existing repository!", false);
View Full Code Here

  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o instanceof Model) {
      Model model = (Model)o;
      return ModelUtil.equals(this, model);
    }
    return false;
  }
View Full Code Here

    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o instanceof Model) {
        Model model = (Model)o;
        return model.isEmpty();
      }
      return false;
    }
View Full Code Here

    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o instanceof Model) {
        Model model = (Model)o;
        return ModelUtil.equals(this, model);
      }
      return false;
    }
View Full Code Here

  @Override
  protected Repository createRepository(String id)
    throws StoreConfigException, StoreException
  {
    Model config = getRepositoryConfig(id);

    if (config != null) {
      RepositoryConfig repConfig = parse(config);

      Repository repository = createRepositoryStack(repConfig.getRepositoryImplConfig());
View Full Code Here

    if (id.equals(SystemRepository.ID)) {
      repInfo = new RepositoryInfo(id, SystemRepository.TITLE);
    }
    else {
      Model model = getRepositoryConfig(id);

      if (model != null) {
        repInfo = new RepositoryInfo(id);

        try {
View Full Code Here

    }

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

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

      InputStream stream = url.openStream();
      try {
        parser.parse(stream, url.toString());
View Full Code Here

      // TODO The SYSTEM repository should be replaced
      try {
        List<String> ids = new ArrayList<String>();

        for (Resource ctx : con.getContextIDs().asList()) {
          Model model = new LinkedHashModel();
          con.match(null, null, null, false, ctx).addTo(model);
          String id = getConfigId(model);
          ids.add(id);

          Model currently = getRepositoryConfig(id);
          if (currently == null || !currently.equals(model)) {
            addRepositoryConfig(id, model);
          }
        }

        Set<String> old = new HashSet<String>(getRepositoryIDs());
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

TOP

Related Classes of org.openrdf.model.Model

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.