/** * Standalone variant of the parser, should be used only * when connection is not available. */ public BigdataTurtleParser() { super(BigdataValueFactoryImpl.getInstance("")); }
@Override protected BigdataValueFactoryImpl newInstance( final String key, final String namespace) { return new BigdataValueFactoryImpl(namespace); } };
@Override public BigdataResource asValue(Resource v) { return (BigdataResource) asValue((Value) v); }
/** * Returns a new blank node with a globally unique blank node ID based on a * {@link UUID}. * <p> * Note: Since the blank node IDs are random, they tend to be uniformly * distributed across the index partition(s). More efficient ordered writes * may be realized using {@link #newBNodeContext()} to obtain a derived * {@link BigdataValueFactory} instance that is specific to a document that * is being loaded into the RDF DB. * * @see #newBNodeContext() */ @Override public BigdataBNodeImpl createBNode() { return createBNode(nextID()); }
return createLiteral(bl.booleanValue()); return createURI(((URI) v).stringValue()); return createBNode(((BigdataBNode) v).getStatement()); return createBNode(((BNode) v).stringValue()); (BigdataURI)asValue(datatype)// );
@Override public BigdataLiteralImpl createLiteral(String label, URI datatype, String language) { /* * Note: The datatype parameter may be null per the Sesame API. * * See https://sourceforge.net/apps/trac/bigdata/ticket/226 */ if (datatype != null && !(datatype instanceof BigdataURIImpl)) { datatype = createURI(datatype.stringValue()); } return new BigdataLiteralImpl(this, label, language, (BigdataURIImpl) datatype); }
@Override public BigdataBNodeImpl createBNode(final BigdataStatement stmt) { // Subject, predicate, object and context should be processed to use the target value factory // See https://jira.blazegraph.com/browse/BLZG-1875 final BigdataResource originalS = stmt.getSubject(); final BigdataURI originalP = stmt.getPredicate(); final BigdataValue originalO = stmt.getObject(); final BigdataResource originalC = stmt.getContext(); final BigdataResource s = asValue(originalS); final BigdataURI p = asValue(originalP); final BigdataValue o = asValue(originalO); final BigdataResource c = asValue(originalC); final BigdataStatement effectiveStmt; if (originalS != s || originalP != p || originalO != o || originalC != c) { effectiveStmt = new BigdataStatementImpl(s, p, o, c, stmt.getStatementType(), stmt.getUserFlag()); } else { effectiveStmt = stmt; } return new BigdataBNodeImpl(this, nextID(), effectiveStmt); }
@Override public BigdataStatementImpl createStatement(Resource s, URI p, Value o, Resource c) { return createStatement(s, p, o, c, null/* type */); }
public BigdataLiteralImpl createLiteral(final Date date) { GregorianCalendar c = new GregorianCalendar(); c.setTime(date); XMLGregorianCalendar xmlGC = DateTimeExtension.datatypeFactorySingleton.newXMLGregorianCalendar(c); return createLiteral(xmlGC); }
@Override public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) { /* * Note: QName#toString() does not produce the right representation, * which is why we need to go through XMLDatatypeUtil. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/117 */ return new BigdataLiteralImpl(this, arg0.toString(), null/* languageCode */, createURI(XMLDatatypeUtil.qnameToURI( arg0.getXMLSchemaType()).stringValue())); }
return createLiteral(bl.booleanValue()); return createURI(((URI) v).stringValue()); return createBNode(((BigdataBNode) v).getStatement()); return createBNode(((BNode) v).stringValue()); (BigdataURI)asValue(datatype)// );
@Override public BigdataLiteralImpl createLiteral(String label, URI datatype, String language) { /* * Note: The datatype parameter may be null per the Sesame API. * * See https://sourceforge.net/apps/trac/bigdata/ticket/226 */ if (datatype != null && !(datatype instanceof BigdataURIImpl)) { datatype = createURI(datatype.stringValue()); } return new BigdataLiteralImpl(this, label, language, (BigdataURIImpl) datatype); }
/** * Returns a new blank node with a globally unique blank node ID based on a * {@link UUID}. * <p> * Note: Since the blank node IDs are random, they tend to be uniformly * distributed across the index partition(s). More efficient ordered writes * may be realized using {@link #newBNodeContext()} to obtain a derived * {@link BigdataValueFactory} instance that is specific to a document that * is being loaded into the RDF DB. * * @see #newBNodeContext() */ @Override public BigdataBNodeImpl createBNode() { return createBNode(nextID()); }
@Override public BigdataBNodeImpl createBNode(final BigdataStatement stmt) { // Subject, predicate, object and context should be processed to use the target value factory // See https://jira.blazegraph.com/browse/BLZG-1875 final BigdataResource originalS = stmt.getSubject(); final BigdataURI originalP = stmt.getPredicate(); final BigdataValue originalO = stmt.getObject(); final BigdataResource originalC = stmt.getContext(); final BigdataResource s = asValue(originalS); final BigdataURI p = asValue(originalP); final BigdataValue o = asValue(originalO); final BigdataResource c = asValue(originalC); final BigdataStatement effectiveStmt; if (originalS != s || originalP != p || originalO != o || originalC != c) { effectiveStmt = new BigdataStatementImpl(s, p, o, c, stmt.getStatementType(), stmt.getUserFlag()); } else { effectiveStmt = stmt; } return new BigdataBNodeImpl(this, nextID(), effectiveStmt); }
@Override public BigdataStatementImpl createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type) { return createStatement(s, p, o, c, type, false/* userFlag */); }
public BigdataLiteralImpl createLiteral(final Date date) { GregorianCalendar c = new GregorianCalendar(); c.setTime(date); XMLGregorianCalendar xmlGC = DateTimeExtension.datatypeFactorySingleton.newXMLGregorianCalendar(c); return createLiteral(xmlGC); }
@Override public BigdataLiteralImpl createLiteral(final XMLGregorianCalendar arg0) { /* * Note: QName#toString() does not produce the right representation, * which is why we need to go through XMLDatatypeUtil. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/117 */ return new BigdataLiteralImpl(this, arg0.toString(), null/* languageCode */, createURI(XMLDatatypeUtil.qnameToURI( arg0.getXMLSchemaType()).stringValue())); }
/** * The value factory to be used when creating axioms. * * @throws IllegalStateException * unless the ctor variant was used that specifies the database. */ final protected BigdataValueFactory getValueFactory() { return BigdataValueFactoryImpl.getInstance(namespace); // return db.getValueFactory(); }
@Override public BigdataLiteral asValue(Literal v) { return (BigdataLiteral)asValue((Value)v); }
@Override public BigdataStatementImpl createStatement(Resource s, URI p, Value o, Resource c, StatementEnum type) { return createStatement(s, p, o, c, type, false/* userFlag */); }