use of org.wikidata.query.rdf.common.uri.UrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method conceptUriHttps.
@Test
public void conceptUriHttps() throws URISyntaxException {
UrisScheme uris = new DefaultUrisScheme(new URI("https://acme2.test"), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
assertThat(uris.entityURIs()).contains("https://acme2.test/entity/");
assertThat(uris.entityIdToURI("Q1")).isEqualTo("https://acme2.test/entity/Q1");
assertThat(uris.entityIdToURI("P1")).isEqualTo("https://acme2.test/entity/P1");
assertThat(uris.entityData()).isEqualTo("https://acme2.test/wiki/Special:EntityData/");
assertThat(uris.entityDataHttps()).isEqualTo("http://acme2.test/wiki/Special:EntityData/");
}
use of org.wikidata.query.rdf.common.uri.UrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method initialsOrder.
@Test
public void initialsOrder() throws URISyntaxException {
UrisScheme uris = new DefaultUrisScheme(new URI("https://acme2.test"), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
// See https://phabricator.wikimedia.org/T230588 for reasons for this order
assertThat(uris.inlinableEntityInitials()).containsExactly("P", "Q");
}
use of org.wikidata.query.rdf.common.uri.UrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method fromHost.
@Test
public void fromHost() {
UrisScheme uris = UrisSchemeFactory.forWikidataHost("acme.test");
assertThat(uris.entityURIs()).contains("http://acme.test/entity/");
assertThat(uris.entityIdToURI("Q1")).isEqualTo("http://acme.test/entity/Q1");
assertThat(uris.entityIdToURI("P1")).isEqualTo("http://acme.test/entity/P1");
assertThat(uris.entityData()).isEqualTo("http://acme.test/wiki/Special:EntityData/");
assertThat(uris.entityDataHttps()).isEqualTo("https://acme.test/wiki/Special:EntityData/");
}
use of org.wikidata.query.rdf.common.uri.UrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method defaultUris.
@Test
public void defaultUris() {
UrisScheme uris = UrisSchemeFactory.getURISystem();
assertThat(uris.entityURIs()).contains("http://www.wikidata.org/entity/");
assertThat(uris.entityIdToURI("Q1")).isEqualTo("http://www.wikidata.org/entity/Q1");
assertThat(uris.entityIdToURI("P1")).isEqualTo("http://www.wikidata.org/entity/P1");
assertThat(uris.entityData()).isEqualTo("http://www.wikidata.org/wiki/Special:EntityData/");
assertThat(uris.entityDataHttps()).isEqualTo("https://www.wikidata.org/wiki/Special:EntityData/");
}
Aggregations