Search in sources :

Example 21 with BigdataStatement

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

the class WikibaseVocabularyUnitTest method valuePAndQAreBytes.

@Test
public void valuePAndQAreBytes() {
    BigdataStatement statement = roundTrip(uris().entityIdToURI("P"), uris().property(PropertyType.STATEMENT_VALUE) + "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 22 with BigdataStatement

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

the class WikibaseGeoUnitTest method geoExtension.

@Test
public void geoExtension() {
    BigdataStatement statement = roundTrip(Ontology.Geo.GLOBE, Ontology.Geo.LATITUDE, pointLiteral("Point(1.2 3.4)"));
    assertThat(statement.getObject().getIV(), instanceOf(LiteralExtensionIV.class));
    assertEquals(statement.getObject().toString(), "\"Point(1.2 3.4)\"^^<" + GeoSparql.WKT_LITERAL + ">");
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) LiteralExtensionIV(com.bigdata.rdf.internal.impl.literal.LiteralExtensionIV) Test(org.junit.Test)

Example 23 with BigdataStatement

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

the class WikibaseGeoUnitTest method geoExtensionGlobe.

@Test
public void geoExtensionGlobe() {
    String point = "<" + uris().entityIdToURI("Q1234") + "> Point(5.6 7.8)";
    BigdataStatement statement = roundTrip(Ontology.Geo.GLOBE, Ontology.Geo.LATITUDE, pointLiteral(point));
    assertThat(statement.getObject().getIV(), instanceOf(LiteralExtensionIV.class));
    assertEquals(statement.getObject().toString(), "\"" + point + "\"^^<" + GeoSparql.WKT_LITERAL + ">");
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) LiteralExtensionIV(com.bigdata.rdf.internal.impl.literal.LiteralExtensionIV) Test(org.junit.Test)

Example 24 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method someValueIsInlined.

@Test
public void someValueIsInlined() {
    BigdataStatement statement = roundTrip(uris().wellKnownBNodeIRIPrefix() + "a10564107110b2d5739b8fe235cddf73", "uri:test", uris().wellKnownBNodeIRIPrefix() + "a10564107110b2d5739b8fe235cddf74");
    assertThat(statement.getSubject().getIV(), uriIv(uris().wellKnownBNodeIRIPrefix(), "a10564107110b2d5739b8fe235cddf73"));
    assertThat(statement.getObject().getIV(), uriIv(uris().wellKnownBNodeIRIPrefix(), "a10564107110b2d5739b8fe235cddf74"));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) Test(org.junit.Test)

Example 25 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method qualifiersAreInlined.

@Test
public void qualifiersAreInlined() {
    BigdataStatement statement = roundTrip("wds:Q23-01EDEEEE-F0DF-4A07-980F-5E76866B74D7", "pq:P1711", 100686);
    assertThat(statement.getSubject().getIV(), instanceOf(TermId.class));
    assertThat(statement.getPredicate().getIV(), uriIv(uris().property(PropertyType.QUALIFIER) + "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)

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