Search in sources :

Example 1 with BigdataStatement

use of com.bigdata.rdf.model.BigdataStatement in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method entityPAndQAreBytes.

/**
 * Make sure the "P" and "Q" suffixed versions of entity are a byte because
 * if they aren't then inline uris are more bloated.
 */
@Test
public void entityPAndQAreBytes() {
    BigdataStatement statement = roundTrip(uris().entityIdToURI("P"), uris().entityIdToURI("Q"), new LiteralImpl("cat"));
    assertThat(statement.getSubject().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) BigdataStatement(com.bigdata.rdf.model.BigdataStatement) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Example 2 with BigdataStatement

use of com.bigdata.rdf.model.BigdataStatement in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method truthyPAndQAreBytes.

@Test
public void truthyPAndQAreBytes() {
    BigdataStatement statement = roundTrip(uris().entityIdToURI("Q"), uris().property(PropertyType.DIRECT) + "P", new LiteralImpl("cat"));
    assertThat(statement.getSubject().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) BigdataStatement(com.bigdata.rdf.model.BigdataStatement) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Example 3 with BigdataStatement

use of com.bigdata.rdf.model.BigdataStatement in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method timeIsInlined.

@Test
public void timeIsInlined() {
    BigdataStatement statement = roundTrip(Ontology.Time.VALUE, Ontology.Time.PRECISION, Ontology.Time.CALENDAR_MODEL);
    assertThat(statement.getSubject().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getObject().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Example 4 with BigdataStatement

use of com.bigdata.rdf.model.BigdataStatement in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method altLabelIsByte.

@Test
public void altLabelIsByte() {
    BigdataStatement statement = roundTrip("entity:Q23", SKOS.ALT_LABEL, new LiteralImpl("G", "en"));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) BigdataStatement(com.bigdata.rdf.model.BigdataStatement) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Example 5 with BigdataStatement

use of com.bigdata.rdf.model.BigdataStatement in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method qualifierPAndQAreBytes.

@Test
public void qualifierPAndQAreBytes() {
    BigdataStatement statement = roundTrip(uris().entityIdToURI("P"), uris().property(PropertyType.QUALIFIER) + "P", new LiteralImpl("cat"));
    assertThat(statement.getSubject().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) BigdataStatement(com.bigdata.rdf.model.BigdataStatement) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Aggregations

BigdataStatement (com.bigdata.rdf.model.BigdataStatement)25 Test (org.junit.Test)25 VocabURIByteIV (com.bigdata.rdf.internal.impl.uri.VocabURIByteIV)15 LiteralImpl (org.openrdf.model.impl.LiteralImpl)10 TermId (com.bigdata.rdf.internal.impl.TermId)5 LiteralExtensionIV (com.bigdata.rdf.internal.impl.literal.LiteralExtensionIV)3 XSDIntegerIV (com.bigdata.rdf.internal.impl.literal.XSDIntegerIV)3