Esempio n. 1
0
  public static void setLabel(
      RepositoryConnection repCon,
      org.openrdf.model.URI concept,
      org.openrdf.model.URI labelType,
      Literal newlabel,
      PersistAndNotifyProvider persistAndNotifyProvider)
      throws RepositoryException {
    repCon.add(concept, labelType, newlabel);

    persistAndNotifyProvider.persistAndNotify(
        Helper.createChangeSetModel(
            concept.stringValue(),
            labelType.stringValue(),
            newlabel,
            ChangeTripleService.CHANGETYPE_ADD),
        true);
  }
Esempio n. 2
0
  public static void addToDatasetAndPersist(
      Statement statement,
      DatasetGraph datasetGraph,
      PersistAndNotifyProvider persistAndNotifyProvider) {
    datasetGraph
        .getDefaultGraph()
        .add(
            new Triple(
                NodeFactory.createURI(statement.getSubject().toString()),
                NodeFactory.createURI(statement.getPredicate().toString()),
                NodeFactory.createURI(statement.getObject().toString())));

    persistAndNotifyProvider.persistAndNotify(
        Helper.createChangeSetModel(
            statement.getSubject().stringValue(),
            statement.getPredicate().stringValue(),
            statement.getObject(),
            ChangeTripleService.CHANGETYPE_ADD),
        true);
  }