@Override public void handleStatement(Statement st) throws RDFHandlerException { graph.add(st); }
@Override public void handleStatement(Statement st) throws RDFHandlerException { graph.add(st); }
public void addType( String subject, URI type ) { URI subjectUri = valueFactory.createURI( subject ); Statement statement = valueFactory.createStatement( subjectUri, Rdfs.TYPE, type ); graph.add( statement ); }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); ValueFactory vf = graph.getValueFactory(); if (url != null) { graph.add(implNode, ENDPOINT, vf.createURI(url)); } for (String space : subjects) { graph.add(implNode, SUBJECT_SPACE, vf.createURI(space)); } return implNode; }
/** * Describe the service end point(s). * * @see #endpoint */ protected void describeServiceEndpoints() { for (String uri : serviceURI) { g.add(aService, SD.endpoint, g.getValueFactory().createURI(uri)); } }
/** * Describe the service end point(s). * * @see #endpoint */ protected void describeServiceEndpoints() { for (String uri : serviceURI) { g.add(aService, SD.endpoint, g.getValueFactory().createURI(uri)); } }
@Override public void handleStatement(Statement st) throws RDFHandlerException { synchronized (bufferLock) { bufferedStatements.add(st); contexts.add(st.getContext()); if (bufferedStatements.size() >= this.bufferSize) { processBuffer(); } } }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
public void addName( String subject, String name ) { Value nameValue = valueFactory.createLiteral( name ); URI subjectUri = valueFactory.createURI( subject ); graph.add( valueFactory.createStatement( subjectUri, Rdfs.LABEL, nameValue ) ); }
public void addRelationship( String subject, URI relationship, String object ) { URI subjectUri = valueFactory.createURI( subject ); URI objectUri = valueFactory.createURI( object ); Statement statement = valueFactory.createStatement( subjectUri, relationship, objectUri ); graph.add( statement ); }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
@Override public Resource export(Graph graph) { Resource implNode = super.export(graph); if (propertiesFile != null) { graph.add(implNode, BigdataConfigSchema.PROPERTIES, graph.getValueFactory().createLiteral(propertiesFile)); } return implNode; }
public void addStatement( String subject, URI predicate, String literal ) { Literal object = valueFactory.createLiteral( literal ); URI subjectUri = valueFactory.createURI( subject ); Statement statement = valueFactory.createStatement( subjectUri, predicate, object ); graph.add( statement ); }
@Override public <E extends Exception> void remove( final Iteration<? extends Statement, E> stmts, final Resource... c) throws RepositoryException, E { final Graph g = new LinkedHashModel(); while (stmts.hasNext()) { g.add(stmts.next()); } remove(g, c); }
@Override public <E extends Exception> void add( final Iteration<? extends Statement, E> stmts, final Resource... c) throws RepositoryException, E { final Graph g = new LinkedHashModel(); while (stmts.hasNext()) { g.add(stmts.next()); } add(g, c); }
private void serializeMixinTypes( final EntityDescriptor entityDescriptor, final Graph graph, final URI entityTypeUri ) { ValueFactory values = graph.getValueFactory(); // Mixin types for( Class<?> mixinType : entityDescriptor.mixinTypes() ) { graph.add( entityTypeUri, Rdfs.SUB_CLASS_OF, values.createURI( Classes.toURI( mixinType ) ) ); } }
protected Graph genNTRIPLES2(final int ntriples) throws RDFHandlerException { final Graph g = new LinkedHashModel(); final ValueFactory f = new ValueFactoryImpl(); final URI s = f.createURI("http://www.bigdata.org/b"); final URI rdfType = f .createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); for (int i = 0; i < ntriples; i++) { final URI o = f.createURI("http://www.bigdata.org/c#" + i); g.add(s, rdfType, o); } return g; }