amalgame/commit

IMPROVED: show all literals in detail view

authorJacco van Ossenbruggen
Sun Mar 29 14:07:24 2015 +0200
committerJacco van Ossenbruggen
Sun Mar 29 14:07:24 2015 +0200
commit847da6345acf9ad1cd708e1879bfc835128b1a2f
treedc1a2e2d66566cf6b4c0f6be49412580d1074c0d
parent24ec2cb78d2c88a8fe6d82e9083287a94069f9b2
Diff style: patch stat
diff --git a/components/amalgame/correspondence.pl b/components/amalgame/correspondence.pl
index 76d2007..3b033ec 100644
--- a/components/amalgame/correspondence.pl
+++ b/components/amalgame/correspondence.pl
@@ -202,6 +202,7 @@ html_resource_context(URI, _Prov) -->
 	{ rdf_display_label(URI, Label),
 	  skos_all_labels(URI, Alt0),
 	  select(Label, Alt0, Alt),
+	  find_other_literals(URI, Alt0, Others),
 	  resource_tree(URI, Tree),
 	  findall(R, skos_related_concept(URI, R), Related),
 	  image_examples(URI, Examples)
@@ -209,6 +210,7 @@ html_resource_context(URI, _Prov) -->
 	html(div(class('resource-info'),
 		 [div(class(label), \html_resource(URI)),
 		  div(class(alt), \html_alt_labels(Alt)),
+		  div(class(other_literals), \html_alt_labels(Others)),
 		  \html_definition(URI),
 		  \html_scope(URI),
 		  \html_resource_tree(Tree),
@@ -216,6 +218,13 @@ html_resource_context(URI, _Prov) -->
 		  \html_image_examples(Examples)
 		 ])).
 
+find_other_literals(URI, Taboo, Others):-
+	findall(Other, is_other_literal(URI, Taboo, Other), Others).
+
+is_other_literal(URI, Taboo, Prop:Other) :-
+	rdf(URI, Prop, literal(Other)),
+	\+ member(Other, Taboo).
+
 html_relations([], _) --> !.
 html_relations([Rel-Label|Rs], Active) -->
 	{ (   Rel == Active
@@ -293,6 +302,11 @@ html_label_list([L|Ls]) -->
 	html([', ']),
 	html_label_list(Ls).
 
+html_label(R:L) -->
+	html_resource(R),
+	html(':'),
+	html(L).
+
 html_label(L) -->
 	html(L).