amalgame/commit

FIXED: many bugs in totally broken isub matcher ...

authorJacco van Ossenbruggen
Mon Mar 2 11:29:09 2020 +0100
committerJacco van Ossenbruggen
Mon Mar 2 11:29:09 2020 +0100
commit2e7ec0476a96643370ed4fa75e4b281e618fb758
tree6feb3ac0afeabce9983f0afa75732b9b85bc9bb6
parentc65dc6912438755868f3a78d6640519cf734728f
Diff style: patch stat
diff --git a/lib/ag_modules/isub_match.pl b/lib/ag_modules/isub_match.pl
index 5633964..7042795 100644
--- a/lib/ag_modules/isub_match.pl
+++ b/lib/ag_modules/isub_match.pl
@@ -2,15 +2,17 @@
 	  [isub_match/3]).
 
 :- use_module(library(option)).
-:- use_module(library(semweb/rdf_db)).
+:- use_module(library(semweb/rdf11)).
 :- use_module(library(semweb/rdf_label)).
 :- use_module(library(isub)).
+:- use_module(string_match_util).
+
 
 isub_match(align(Source, Target, Prov0), align(Source, Target, [Prov|Prov0]), Options) :-
 	rdf_equal(skos:definition, DefaultProp),
 	option(threshold(Threshold), Options, 0.0),
-	option(sourcelabel(MatchProp1), Options, DefaultProp),
-	option(targetlabel(MatchProp2), Options, DefaultProp),
+	option(sourcelabel(MatchPropS), Options, DefaultProp),
+	option(targetlabel(MatchPropT), Options, DefaultProp),
 	option(matchacross_lang(MatchAcross), Options, true),
 	option(normalize(Normalize), Options, false),
 	option(source_language(Lang), Options, 'any'),
@@ -26,16 +28,13 @@ isub_match(align(Source, Target, Prov0), align(Source, Target, [Prov|Prov0]), Op
 	;   true
 	),
 
-	SearchTarget=literal(lang(TargetLang, TargetLit)),
 
-	(   rdf_has(Source, MatchProp1,  literal(lang(SourceLang, SourceLit)), SourceProp),
-	    rdf_has(Target, MatchProp2, SearchTarget, TargetProp),
-	    Source \== Target
-	->  literal_text(SourceLit, SourceTxt),
-	    literal_text(TargetLit, TargetTxt),
-	    isub(SourceTxt, TargetTxt, Normalize, Similarity)
-	;   Similarity = 0
-	),
+	skos_has(Source, MatchPropS, SourceLit@SourceLang, SourceProp, Options),
+	skos_has(Target, MatchPropT, TargetLit@TargetLang, TargetProp, Options),
+	Source \== Target,
+	literal_text(SourceLit, SourceTxt),
+	literal_text(TargetLit, TargetTxt),
+	isub(SourceTxt, TargetTxt, Normalize, Similarity),
 	Similarity > Threshold,
 	Prov = [method(isub),
 		match(Similarity),