amalgame/commit
RENAMED: skos_match/5 -> skos_has/5
author | Jacco van Ossenbruggen |
---|---|
Fri Jul 19 15:21:59 2019 +0200 | |
committer | Jacco van Ossenbruggen |
Fri Jul 19 15:21:59 2019 +0200 | |
commit | 47169ac584adbe229e287094247ddce06cfb18b5 |
tree | bfa75e9255d8146371fb2368d10550ea1f5b1d05 |
parent | 9e1a650187a7b3363ee58173325f748b816dfa5b |
Diff style: patch stat
diff --git a/lib/ag_modules/compound_label_match.pl b/lib/ag_modules/compound_label_match.pl index 802d293..8fd6d6f 100644 --- a/lib/ag_modules/compound_label_match.pl +++ b/lib/ag_modules/compound_label_match.pl @@ -42,14 +42,14 @@ compound_label_match(align(Source, Target, Prov0), ; SearchTarget=literal(exact(Token), lang(TargetLang, TargetLabel)) ), - skos_match(Source, MatchPropS, + skos_has(Source, MatchPropS, literal(lang(SourceLang, SourceLabel)), SourceProp, Options), SourceLabel \= '', rdf_tokenize_literal(SourceLabel, Tokens), length(Tokens, TokenLength), TokenLength > 0, member(Token, Tokens), atom(Token), - skos_match(Target, MatchPropT, SearchTarget, TargetProp, Options), + skos_has(Target, MatchPropT, SearchTarget, TargetProp, Options), ( option(target_scheme(TargetScheme), Options) -> vocab_member(Target, TargetScheme) diff --git a/lib/ag_modules/exact_label_match.pl b/lib/ag_modules/exact_label_match.pl index 401ebb4..7de0888 100644 --- a/lib/ag_modules/exact_label_match.pl +++ b/lib/ag_modules/exact_label_match.pl @@ -41,11 +41,11 @@ exact_label_match(align(Source, Target, Prov0), ; true ), - skos_match(Source, MatchPropS, + skos_has(Source, MatchPropS, literal(lang(SourceLang, SourceLabel)), SourceProp, Options), SourceLabel \= '', - skos_match(Target, MatchPropT, SearchTarget, + skos_has(Target, MatchPropT, SearchTarget, TargetProp, Options), Source \= Target, diff --git a/lib/ag_modules/snowball_label_match.pl b/lib/ag_modules/snowball_label_match.pl index 7b65998..f427d7f 100644 --- a/lib/ag_modules/snowball_label_match.pl +++ b/lib/ag_modules/snowball_label_match.pl @@ -30,7 +30,7 @@ snowball_label_match(align(Source, Target, Prov0), ; true ), - skos_match(Source, MatchProp1, literal(lang(SourceLang, SourceLabel)), SourceProp, Options), + skos_has(Source, MatchProp1, literal(lang(SourceLang, SourceLabel)), SourceProp, Options), ( sub_atom(SourceLabel, 0, PrefixLength, _, Prefix) -> true @@ -39,7 +39,7 @@ snowball_label_match(align(Source, Target, Prov0), downcase_atom(SourceLabel, SourceLabel0), snowball(Snowball_Language, SourceLabel0, SourceStem), - skos_match(Target, MatchProp2, literal(prefix(Prefix), lang(TargetLang, TargetLabel)), TargetProp, Options), + skos_has(Target, MatchProp2, literal(prefix(Prefix), lang(TargetLang, TargetLabel)), TargetProp, Options), ( option(target_scheme(TargetScheme), Options) -> vocab_member(Target, TargetScheme) ; true diff --git a/lib/ag_modules/string_match_util.pl b/lib/ag_modules/string_match_util.pl index 2e47a74..707f421 100644 --- a/lib/ag_modules/string_match_util.pl +++ b/lib/ag_modules/string_match_util.pl @@ -1,6 +1,6 @@ :- module(ag_string_match_util, [label_list/1, - skos_match/5, + skos_has/5, matching_types/2 ]). @@ -22,7 +22,7 @@ label_list(LabelProps) :- LabelProps0), sort(LabelProps0, LabelProps). -%% skos_match(Concept, Prop, Lit, RealProp) is nondet. +%% skos_has(Concept, Prop, Lit, RealProp) is nondet. % % Like rdf_has(Concept, Prop, Lit, RealProp), but skosxl-aware. % @@ -32,10 +32,10 @@ label_list(LabelProps) :- % ** via amalgame:term if literal objects as amalgame:qualifier % ** via skosxl:literalForm if no amalgame:qualifier -skos_match(Concept, MatchProp, Literal, RealProp, _Options) :- +skos_has(Concept, MatchProp, Literal, RealProp, _Options) :- rdf_has(Concept, MatchProp, Literal, RealProp). -skos_match(Concept, MatchProp, Literal, RealProp, Options) :- +skos_has(Concept, MatchProp, Literal, RealProp, Options) :- nonvar(Concept), rdf_has(Concept, MatchProp, LiteralObject, RealProp), rdf_subject(LiteralObject), @@ -46,7 +46,7 @@ skos_match(Concept, MatchProp, Literal, RealProp, Options) :- ; rdf_has(LiteralObject, skosxl:literalForm, Literal) ). -skos_match(Concept, MatchProp, Literal, RealProp, Options) :- +skos_has(Concept, MatchProp, Literal, RealProp, Options) :- var(Concept), ( ( option(match_qualified_only(true), Options, false), rdf_has(_, amalgame:term, Literal) diff --git a/lib/amalgame/scheme_stats.pl b/lib/amalgame/scheme_stats.pl index fcc72c3..e2b6756 100644 --- a/lib/amalgame/scheme_stats.pl +++ b/lib/amalgame/scheme_stats.pl @@ -14,6 +14,7 @@ :- use_module(library(stat_lists)). :- use_module(library(amalgame/ag_strategy)). :- use_module(library(amalgame/ag_provenance)). +:- use_module(library(ag_modules/string_match_util)). :- rdf_meta fcplp(+, r, r, r, -, -). @@ -160,7 +161,7 @@ concept_stat(C, Skos, SkosXLa, SkosXLp) :- findall((Prop:Lang)-(Label-C), fcplp(skosxl, C, skosxl:altLabel, Prop, Lang, Label), SkosXLa). fcplp(Format, Concept, Prop, RealProp, Lang, Label) :- - skos_match(Concept, Prop, Literal, RealProp, [format(Format)]), + skos_has(Concept, Prop, Literal, RealProp, [format(Format)]), ( var(Label) -> ( Literal = literal(lang(Lang, Label)) -> true