/** * {@inheritDoc } */ @Override public void persist(ResourceObject resource) throws RepositoryException { connection.addObject(resource); }
protected Value getValue(Object instance) throws RepositoryException { return getObjectConnection().addObject(instance); }
protected Value getValue(Object instance) throws RepositoryException { return getObjectConnection().addObject(instance); }
/** * Imports the entity into the RDF store using the given URI. */ public void addObject(String uri, Object entity) throws RepositoryException { addObject(getValueFactory().createURI(uri), entity); }
/** * Imports the entity into the RDF store using the given URI. */ public void addObject(String uri, Object entity) throws RepositoryException { addObject(getValueFactory().createURI(uri), entity); }
public void generateSimilarity(Annotation subject, Annotation object, String algorithmName) { SimilarityAlgorithm algorithm = this.algorithms.get(algorithmName); double similarity = algorithm.calculateSimilarity(subject, object); try { Annotation anno = createSimilarityAnnotation(subject, object, similarity); this.anno4j.getObjectRepository().getConnection().addObject(anno); } catch (RepositoryException | InstantiationException | IllegalAccessException e) { e.printStackTrace(); } }
private void assign(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); Value newValue = getObjectConnection().addObject(o); ObjectConnection conn = getObjectConnection(); conn.add(getResource(), pred, newValue); clearBlock(index / BSIZE); }
private void assign(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); Value newValue = getObjectConnection().addObject(o); ObjectConnection conn = getObjectConnection(); conn.add(getResource(), pred, newValue); clearBlock(index / BSIZE); }
private Object getAndSet(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); Object old = get(index); ObjectConnection conn = getObjectConnection(); if (old != null) { conn.remove(getResource(), pred, null); } conn.add(getResource(), pred, conn.addObject(o)); Object[] block = getBlock(index / BSIZE); if (block != null) { block[index % BSIZE] = o; } return old; }
private Object getAndSet(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); Object old = get(index); ObjectConnection conn = getObjectConnection(); if (old != null) { conn.remove(getResource(), pred, null); } conn.add(getResource(), pred, conn.addObject(o)); Object[] block = getBlock(index / BSIZE); if (block != null) { block[index % BSIZE] = o; } return old; }
Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { addObject(resource, delegate); return;
removeStatements(list, RDF.FIRST, first); if (o != null) { Value obj = getObjectConnection().addObject(o); addStatement(list, RDF.FIRST, obj);
Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { addObject(resource, delegate); return;
removeStatements(list, RDF.FIRST, first); if (o != null) { Value obj = getObjectConnection().addObject(o); addStatement(list, RDF.FIRST, obj);
private void replace(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); ObjectConnection conn = getObjectConnection(); Value newValue = getObjectConnection().addObject(o); boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { conn.remove(getResource(), pred, null); conn.add(getResource(), pred, newValue); if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } Object[] block = getBlock(index / BSIZE); if (block != null) { block[index % BSIZE] = o; } }
private void replace(int index, Object o) throws RepositoryException { if (o == null) throw new NullPointerException(); URI pred = getMemberPredicate(index); ObjectConnection conn = getObjectConnection(); Value newValue = getObjectConnection().addObject(o); boolean autoCommit = conn.isAutoCommit(); if (autoCommit) conn.setAutoCommit(false); try { conn.remove(getResource(), pred, null); conn.add(getResource(), pred, newValue); if (autoCommit) conn.setAutoCommit(true); } finally { if (autoCommit && !conn.isAutoCommit()) { conn.rollback(); conn.setAutoCommit(true); } } Object[] block = getBlock(index / BSIZE); if (block != null) { block[index % BSIZE] = o; } }
.addObject(o); if (getFirst(getResource()) == null) {
.addObject(o); if (getFirst(getResource()) == null) {