amalgame/commit

ADDED: TypePartition as our first concrete partition/5 module

authorJacco van Ossenbruggen
Tue Sep 2 17:29:59 2014 +0200
committerJacco van Ossenbruggen
Tue Sep 2 17:29:59 2014 +0200
commitf6c0d84fbc1625abb9b7c6db58267e690534ef7b
treefd8063e3ae74df7f1eae3e4ede338a34182a899d
parented33c6278beedda7c0fe38127420cd05fdc18e02
Diff style: patch stat
diff --git a/lib/ag_modules/type_select.pl b/lib/ag_modules/type_select.pl
index 2c84d07..6c43648 100644
--- a/lib/ag_modules/type_select.pl
+++ b/lib/ag_modules/type_select.pl
@@ -3,20 +3,26 @@
 :- public amalgame_module/1.
 :- public parameter/4.
 :- public selecter/3.
+:- public partition/5.
 
 amalgame_module(amalgame:'TypeSelect').
+amalgame_module(amalgame:'TypePartition').
 
 parameter(class, uri, '',
 	  'rdfs:Class from which to select the concepts').
 parameter(mode, oneof([select, remove]), select,
 	  'select or remove concepts of this type').
 
-% a bit naive at the moment: we simply change the query that should be
-% done.
-
 selecter(Scheme, and((Scheme), type(Class)), Options) :-
 	option(mode(select), Options),
 	option(class(Class), Options).
 selecter(Scheme, and((Scheme), not(type(Class))), Options) :-
 	option(mode(remove), Options),
 	option(class(Class), Options).
+
+partition(VocSpec, Sel, Dis, [], Options) :-
+	option(mode(select), Options),
+	option(class(Class), Options),
+	Sel = and((VocSpec), type(Class)),
+	Dis = and((VocSpec), not(type(Class))).
+
diff --git a/rdf/tool/ag_modules.ttl b/rdf/tool/ag_modules.ttl
index 0d9cdb8..4f10bc4 100644
--- a/rdf/tool/ag_modules.ttl
+++ b/rdf/tool/ag_modules.ttl
@@ -121,6 +121,11 @@ amalgame:VocExclude
     skos:definition "Subtract from a vocabulary the sources or targets from a given mapping to create a vocabulary with the unmapped concepts."@en ;
     rdfs:subClassOf amalgame:VirtualVocabSelecter .
 
+amalgame:TypePartition
+    rdfs:label "partition facet on type"@en ;
+    skos:definition "Partition from a vocabulary based on the concepts being of a specific type or not."@en ;
+    rdfs:subClassOf amalgame:VirtualVocabPartitioner .
+
 amalgame:TypeSelect
     rdfs:label "select facet on type"@en ;
     skos:definition "Select from a vocabulary the concepts of a specific type."@en ;