rdf-mt/commit

Derive relations from range and datatypes.

authorJan Wielemaker
Tue Dec 17 15:50:49 2013 +0100
committerJan Wielemaker
Tue Dec 17 15:50:49 2013 +0100
commit48ebfede929674cf64f9624563498a8902451952
treebebe0f537f991afb937d6f739d1ee73c54ca8636
parent9299e39f6f11ce05aa7c419de9e4506a1c9d87b4
Diff style: patch stat
diff --git a/lib/rdf_mt/mt_rdfs.pl b/lib/rdf_mt/mt_rdfs.pl
index 02a8787..bcd014a 100644
--- a/lib/rdf_mt/mt_rdfs.pl
+++ b/lib/rdf_mt/mt_rdfs.pl
@@ -47,6 +47,10 @@ Terminology:
 % rdfs1 @@
 % any IRI aaa in D ==> aaa rdf:type rdfs:Datatype .
 
+		 /*******************************
+		 *	     DATA TYPES		*
+		 *******************************/
+
 literal_type(type(Type, _), Type) :- !.
 literal_type(lang(_, _),    rdf:langString) :- !.
 literal_type(_Plain,        xsd:string).
@@ -69,6 +73,21 @@ rdfs1 @@
 	{ BN, rdf:type, Type },
 	{ BN, rdf:type, rdfs:'Literal' }.
 
+% Test 'datatypes-range-clash'
+
+rdf_datatype @@
+{ S, P, L },
+{ S, P, BN },
+{ BN, rdf:type, Type },
+{ P, rdfs:range, Class } ==>
+	nonvar(L), L = literal(_),
+	{ Type, rdfs:subClassOf, Class }.
+
+
+		 /*******************************
+		 *	     RESOURCES		*
+		 *******************************/
+
 rdfs2 @@
 { A, rdfs:domain, X },
 { Y, A, _Z } ==>