rdf_qa/commit

added qa:rdf_qa_ok/2 hook, no label warning

authorJacco van Ossenbruggen
Tue Jan 31 14:19:24 2012 +0100
committerJacco van Ossenbruggen
Tue Jan 31 14:19:24 2012 +0100
commit83a59ec0c56c5cd0dfe4f07fea57dcfeca444999
tree7c3389bfcbe56bf8382857d125ddce08aaf1372c
parent75e3fd54c69afef7cb078558126fa0e575fe6c17
Diff style: patch stat
diff --git a/components/qa_default_heuristics.pl b/components/qa_default_heuristics.pl
index 3d0f5e6..0203d61 100644
--- a/components/qa_default_heuristics.pl
+++ b/components/qa_default_heuristics.pl
@@ -2,3 +2,4 @@
 
 :- use_module(qa_cycle_prop).
 :- use_module(qa_empty_repo).
+:- use_module(qa_no_label).
diff --git a/components/qa_heuristics.pl b/components/qa_heuristics.pl
index 7128f3d..04b5458 100644
--- a/components/qa_heuristics.pl
+++ b/components/qa_heuristics.pl
@@ -5,8 +5,10 @@
 
 :- multifile
 	qa:rdf_warning/2,
+	qa:rdf_qa_ok/2,
 	qa:class_label//1.
 
+
 :- rdf_meta
 	qa:rdf_warning(o,r).
 
diff --git a/components/qa_no_label.pl b/components/qa_no_label.pl
new file mode 100644
index 0000000..82238a3
--- /dev/null
+++ b/components/qa_no_label.pl
@@ -0,0 +1,16 @@
+:- module(qa_no_label, []).
+
+:- use_module(qa_heuristics).
+:- use_module(library(semweb/rdf_db)).
+:- use_module(library(semweb/rdf_label)).
+:- use_module(library(http/html_write)).
+
+
+qa:rdf_warning(no_label, URI) :-
+	rdf_subject(URI),
+	\+ rdf_is_bnode(URI),
+	\+ rdf_label(URI, _),
+	\+ qa:rdf_qa_ok(no_label, URI).
+
+qa:class_label(no_label) -->
+        html(['URIs without label']).