use of org.wikidata.query.rdf.common.uri.DefaultUrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method testBNodeSkolemIRIPrefix.
@Test
public void testBNodeSkolemIRIPrefix() throws URISyntaxException {
UrisScheme uris = new DefaultUrisScheme(new URI("http://acme2.test"), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
assertThat(uris.wellKnownBNodeIRIPrefix()).isEqualTo("http://acme2.test/.well-known/genid/");
}
use of org.wikidata.query.rdf.common.uri.DefaultUrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method conceptUri.
@Test
public void conceptUri() throws URISyntaxException {
UrisScheme uris = new DefaultUrisScheme(new URI("http://acme.test/prefix"), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
assertThat(uris.entityURIs()).contains("http://acme.test/prefix/entity/");
assertThat(uris.entityIdToURI("Q1")).isEqualTo("http://acme.test/prefix/entity/Q1");
assertThat(uris.entityIdToURI("P1")).isEqualTo("http://acme.test/prefix/entity/P1");
assertThat(uris.entityData()).isEqualTo("http://acme.test/prefix/wiki/Special:EntityData/");
assertThat(uris.entityDataHttps()).isEqualTo("https://acme.test/prefix/wiki/Special:EntityData/");
}
use of org.wikidata.query.rdf.common.uri.DefaultUrisScheme in project wikidata-query-rdf by wikimedia.
the class DefaultUrisSchemeUnitTest method conceptUriSlash.
@Test
public void conceptUriSlash() throws URISyntaxException {
UrisScheme uris = new DefaultUrisScheme(new URI("http://acme3.test/"), WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
assertThat(uris.entityURIs()).contains("http://acme3.test/entity/");
assertThat(uris.entityIdToURI("Q1")).isEqualTo("http://acme3.test/entity/Q1");
assertThat(uris.entityIdToURI("P1")).isEqualTo("http://acme3.test/entity/P1");
assertThat(uris.entityData()).isEqualTo("http://acme3.test/wiki/Special:EntityData/");
assertThat(uris.entityDataHttps()).isEqualTo("https://acme3.test/wiki/Special:EntityData/");
}
use of org.wikidata.query.rdf.common.uri.DefaultUrisScheme in project wikidata-query-rdf by wikimedia.
the class FederatedUrisSchemeUnitTest method initURIs.
@Before
public void initURIs() throws URISyntaxException {
final URI commonsUrl = new URI("http://acme.commons/something");
final URI wikidataUrl = new URI("http://acme.test/prefix");
DefaultUrisScheme sdcUris = new DefaultUrisScheme(commonsUrl, SDC_ENTITY_PREFIX, SDC_ENTITY_DATA_PREFIX, singletonList(MEDIAINFO_INITIAL));
DefaultUrisScheme wikibaseUris = new DefaultUrisScheme(wikidataUrl, WIKIBASE_ENTITY_PREFIX, WIKIBASE_ENTITY_DATA_PREFIX, WIKIBASE_INITIALS);
uris = new FederatedUrisScheme(sdcUris, wikibaseUris);
}
use of org.wikidata.query.rdf.common.uri.DefaultUrisScheme 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/");
}
Aggregations