Search in sources :

Example 56 with LiteralImpl

use of org.openrdf.model.impl.LiteralImpl 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 57 with LiteralImpl

use of org.openrdf.model.impl.LiteralImpl 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 58 with LiteralImpl

use of org.openrdf.model.impl.LiteralImpl 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)

Example 59 with LiteralImpl

use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method descriptionIsByte.

@Test
public void descriptionIsByte() {
    BigdataStatement statement = roundTrip("entity:Q23", SchemaDotOrg.DESCRIPTION, new LiteralImpl("some dude", "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 60 with LiteralImpl

use of org.openrdf.model.impl.LiteralImpl in project wikidata-query-rdf by wikimedia.

the class WikibaseVocabularyUnitTest method labelIsByte.

@Test
public void labelIsByte() {
    BigdataStatement statement = roundTrip("entity:Q23", RDFS.LABEL, new LiteralImpl("George", "en"));
    /*
         * See WikibaseInlineUrIFactoryUnitTest for tests about the entity
         * namespace.
         */
    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

LiteralImpl (org.openrdf.model.impl.LiteralImpl)155 Test (org.junit.Test)124 URIImpl (org.openrdf.model.impl.URIImpl)62 BindingSet (org.openrdf.query.BindingSet)58 Statement (org.openrdf.model.Statement)40 ArrayList (java.util.ArrayList)34 TupleQueryResult (org.openrdf.query.TupleQueryResult)34 QueryBindingSet (org.openrdf.query.algebra.evaluation.QueryBindingSet)33 URI (org.openrdf.model.URI)29 IntegerLiteralImpl (org.openrdf.model.impl.IntegerLiteralImpl)23 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)22 HashSet (java.util.HashSet)21 RyaStatement (org.apache.rya.api.domain.RyaStatement)19 RyaType (org.apache.rya.api.domain.RyaType)19 RyaURI (org.apache.rya.api.domain.RyaURI)19 ParsedQuery (org.openrdf.query.parser.ParsedQuery)19 SPARQLParser (org.openrdf.query.parser.sparql.SPARQLParser)19 StatementMetadata (org.apache.rya.api.domain.StatementMetadata)17 StatementImpl (org.openrdf.model.impl.StatementImpl)16 NumericLiteralImpl (org.openrdf.model.impl.NumericLiteralImpl)15