Search in sources :

Example 16 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method valueIsInlined.

@Test
public void valueIsInlined() {
    BigdataStatement statement = roundTrip("wds:Q23-01EDEEEE-F0DF-4A07-980F-5E76866B74D7", "p:P1711", 100686);
    assertThat(statement.getSubject().getIV(), instanceOf(TermId.class));
    assertThat(statement.getPredicate().getIV(), uriIv(uris().property(PropertyType.CLAIM) + "P", "1711"));
    assertThat(statement.getObject().getIV(), instanceOf(XSDIntegerIV.class));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) XSDIntegerIV(com.bigdata.rdf.internal.impl.literal.XSDIntegerIV) TermId(com.bigdata.rdf.internal.impl.TermId) Test(org.junit.Test)

Example 17 with BigdataStatement

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

the class WikibaseVocabularyUnitTest method ranksAreBytes.

@Test
public void ranksAreBytes() {
    BigdataStatement statement = roundTrip("s:Q23-uuidhere", Ontology.RANK, Ontology.BEST_RANK);
    assertThat(statement.getSubject().getIV(), instanceOf(TermId.class));
    assertThat(statement.getPredicate().getIV(), instanceOf(VocabURIByteIV.class));
    assertThat(statement.getObject().getIV(), instanceOf(VocabURIByteIV.class));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) TermId(com.bigdata.rdf.internal.impl.TermId) VocabURIByteIV(com.bigdata.rdf.internal.impl.uri.VocabURIByteIV) Test(org.junit.Test)

Example 18 with BigdataStatement

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

the class WikibaseVocabularyUnitTest method versionIsByte.

@Test
public void versionIsByte() {
    BigdataStatement statement = roundTrip("entity:Q23", SchemaDotOrg.VERSION, new LiteralImpl("its a number", "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 19 with BigdataStatement

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

the class WikibaseVocabularyUnitTest method entityTruthyAndStatementAreBytes.

@Test
public void entityTruthyAndStatementAreBytes() {
    uris().entityURIs().forEach(prefix -> {
        BigdataStatement statement = roundTrip(prefix, uris().property(PropertyType.DIRECT) + "P", uris().statement());
        assertThat(statement.getSubject().getIV(), instanceOf(VocabURIByteIV.class));
    });
    BigdataStatement statement = roundTrip(uris().entityIdToURI("Q"), uris().property(PropertyType.DIRECT) + "P", uris().statement());
    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 20 with BigdataStatement

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

the class WikibaseVocabularyUnitTest method dateModifiedIsByte.

@Test
public void dateModifiedIsByte() {
    BigdataStatement statement = roundTrip("entity:Q23", SchemaDotOrg.DATE_MODIFIED, new LiteralImpl("its a date!", "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)

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