Skip to content

Commit

Permalink
Rename "target_language" to "select_language"
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Dec 13, 2022
1 parent 1d0e542 commit b49445d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*/
public final class RdfMap extends AbstractReadOnlyMap<String, String> {
public static final String TARGET = "target";
public static final String TARGET_LANGUAGE = "target_language";
public static final String TARGET_LANGUAGE = "select_language";
public static final String SELECT = "select";
private static final int MAX_REDIRECTIONS = 10;
private static final int MIN_HTTP_STATUS_CODE = 299;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ public void shouldLookupRdfUrlWithRedirection() {
public void shouldLookupInExternalRdfMapGetObjectOfSubjectWithTargetedPredicateOfSpecificLanguage() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('prefLabel', 'https://w3id.org/kim/hochschulfaechersystematik/n4')",
"lookup_rdf('prefLabel.*', '" + RDF_MAP + "', target: 'skos:prefLabel', target_language: 'de')"
"lookup_rdf('prefLabel.*', '" + RDF_MAP + "', target: 'skos:prefLabel', select_language: 'de')"
),
i -> {
i.startRecord("1");
Expand All @@ -1067,7 +1067,7 @@ public void shouldLookupInExternalRdfMapGetObjectOfSubjectWithTargetedPredicateO
public void shouldLookupInExternalRdfMapGetSubjectWithTargetedPredicateOfSpecificLanguage() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('id', 'Mathematics, Natural Sciences')",
"lookup_rdf('id.*', '" + RDF_MAP + "', target: 'skos:prefLabel', target_language: 'en')"
"lookup_rdf('id.*', '" + RDF_MAP + "', target: 'skos:prefLabel', select_language: 'en')"
),
i -> {
i.startRecord("1");
Expand All @@ -1086,7 +1086,7 @@ public void shouldLookupInExternalRdfMapGetSubjectWithTargetedPredicateOfSpecifi
@Test // Scenario lookupRdfPropertyToProperty
public void shouldLookupInExternalRdfMapGetPropertyOfSpecificLanguageWithTargetedPredicate() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', target_language: 'en')"
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', select_language: 'en')"
),
i -> {
i.startRecord("1");
Expand Down Expand Up @@ -1122,7 +1122,7 @@ public void shouldLookupInExternalRdfMapGetSubjectOfPropertyWithTargetedPredicat
@Test
public void lookupRdfDefinedPropertyToSubjectNonDefault() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', target_language: 'de')"
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', select_language: 'de')"
),
i -> {
i.startRecord("1");
Expand Down Expand Up @@ -1160,7 +1160,7 @@ public void shouldLookupInExternalRdfMapGetObjectWithTargetedPredicateOfSpecific
@Test
public void shouldLookupRdfDefinedPropertyToSubject() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', target_language: 'de', select: 'subject')"
"lookup_rdf('a', '" + HCRT_RDF_MAP + "', target: 'skos:prefLabel', select_language: 'de', select: 'subject')"
),
i -> {
i.startRecord("1");
Expand Down Expand Up @@ -1204,7 +1204,7 @@ public void shouldLookupRdfDefinedPropertyToSubject() {
private void shouldLookupInExternalRdfMapGetObjectWithTargetedPredicateOfSpecificLanguage(final String target) {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('prefLabel', 'Mathematics, Natural Sciences')",
"lookup_rdf('prefLabel.*', '" + RDF_MAP + "', target: '" + target + "', target_language: 'de')"
"lookup_rdf('prefLabel.*', '" + RDF_MAP + "', target: '" + target + "', select_language: 'de')"
),
i -> {
i.startRecord("1");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", target_language: "en", select: "object")
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", select_language: "en")
# Cant define specific lookup-match fields, would expect something like this:
# lookup_rdf("a", "./hcrt.ttl", match="http://www.w3.org/2004/02/skos/core#prefLabel", match_language: "de", target: "http://www.w3.org/2004/02/skos/core#prefLabel", target_language: "en")
# lookup_rdf("a", "./hcrt.ttl", match="http://www.w3.org/2004/02/skos/core#prefLabel", match_language: "de", target: "http://www.w3.org/2004/02/skos/core#prefLabel", select_language: "en")

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lookup_rdf('a', '../../../../../maps/hcrt.ttl', target: 'http://www.w3.org/2004/02/skos/core#prefLabel', target_language: 'de', select: 'subject')
lookup_rdf('a', '../../../../../maps/hcrt.ttl', target: 'http://www.w3.org/2004/02/skos/core#prefLabel', select_language: 'de', select: 'subject')
# Cant define specific lookup-match fields, would expect something like this:
# lookup_rdf("a", "./hcrt.ttl", match="http://www.w3.org/2004/02/skos/core#prefLabel", match_language: "de")

Original file line number Diff line number Diff line change
@@ -1 +1 @@
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", target_language: 'en')
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", select_language: 'en')
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Lookup replaces with default value by default. Should be an option.
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", target_language: "de")
lookup_rdf("a", "../../../../../maps/hcrt.ttl", target: "http://www.w3.org/2004/02/skos/core#prefLabel", select_language: "de")

0 comments on commit b49445d

Please sign in to comment.