Search in sources :

Example 11 with BigdataStatement

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

the class WikibaseDateUnitTest method dateExtension.

@Test
public void dateExtension() {
    BigdataStatement statement = roundTrip(Ontology.Time.VALUE, Ontology.Time.VALUE, new LiteralImpl("-0101-01-01T00:00:00", XMLSchema.DATE));
    assertThat(statement.getObject().getIV(), instanceOf(LiteralExtensionIV.class));
}
Also used : LiteralImpl(org.openrdf.model.impl.LiteralImpl) BigdataStatement(com.bigdata.rdf.model.BigdataStatement) LiteralExtensionIV(com.bigdata.rdf.internal.impl.literal.LiteralExtensionIV) Test(org.junit.Test)

Example 12 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method expandedValuesAreInlined.

@Test
public void expandedValuesAreInlined() {
    BigdataStatement statement = roundTrip("wds:Q23-01EDEEEE-F0DF-4A07-980F-5E76866B74D7", "psv:P580", "wdv:a10564107110b2d5739b8fe235cddf73");
    assertThat(statement.getSubject().getIV(), instanceOf(TermId.class));
    assertThat(statement.getPredicate().getIV(), uriIv(uris().property(PropertyType.STATEMENT_VALUE) + "P", "580"));
    assertThat(statement.getObject().getIV(), uriIv(uris().value(), "a10564107110b2d5739b8fe235cddf73"));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) TermId(com.bigdata.rdf.internal.impl.TermId) Test(org.junit.Test)

Example 13 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method qualifierValuesAreInlined.

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

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

the class WikibaseInlineUriFactoryUnitTest method viafIsInlined.

@Test
public void viafIsInlined() {
    BigdataStatement statement = roundTrip(CommonValues.VIAF + "123313", CommonValues.VIAF_HTTP + "1234555", CommonValues.VIAF_HTTP + "23466/");
    assertThat(statement.getSubject().getIV(), uriIv(CommonValues.VIAF_HTTP, "123313"));
    assertThat(statement.getPredicate().getIV(), uriIv(CommonValues.VIAF_HTTP, "1234555"));
    assertThat(statement.getObject().getIV(), uriIv(CommonValues.VIAF_HTTP, "23466"));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) Test(org.junit.Test)

Example 15 with BigdataStatement

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

the class WikibaseInlineUriFactoryUnitTest method entityAndTruthyAreInlined.

@Test
public void entityAndTruthyAreInlined() {
    BigdataStatement statement = roundTrip("wd:Q23", "wdt:P509", "wd:Q356405");
    assertThat(statement.getSubject().getIV(), uriIv(uris().entityIdToURI("Q"), "23"));
    assertThat(statement.getPredicate().getIV(), uriIv(uris().property(PropertyType.DIRECT) + "P", "509"));
    assertThat(statement.getObject().getIV(), uriIv(uris().entityIdToURI("Q"), "356405"));
}
Also used : BigdataStatement(com.bigdata.rdf.model.BigdataStatement) 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