amalgame/commit

added property/value selecter on vocabs

authorJacco van Ossenbruggen
Fri Jun 21 18:45:23 2013 +0200
committerJacco van Ossenbruggen
Fri Jun 21 18:45:23 2013 +0200
commit1d6a9e17e908584729a121e476baf805bd53ba03
tree47909c648688b6f97ff813c74ccb38b59619d9df
parent48eec289efb7bb570121fc07a02f74c187a8b805
Diff style: patch stat
diff --git a/config-available/ag_modules.pl b/config-available/ag_modules.pl
index 1a46226..052957b 100644
--- a/config-available/ag_modules.pl
+++ b/config-available/ag_modules.pl
@@ -24,6 +24,7 @@
 % Vocabulary filters/selecters
 :- use_module(library(ag_modules/voc_exclude)).
 :- use_module(library(ag_modules/type_select)).
+:- use_module(library(ag_modules/propvalue_select)).
 
 % Mergers
 :- use_module(library(ag_modules/map_merger)).
diff --git a/lib/ag_modules/propvalue_select.pl b/lib/ag_modules/propvalue_select.pl
new file mode 100644
index 0000000..3c638a0
--- /dev/null
+++ b/lib/ag_modules/propvalue_select.pl
@@ -0,0 +1,19 @@
+:- module(propvalue_select, []).
+
+:- public amalgame_module/1.
+:- public parameter/4.
+:- public selecter/3.
+
+amalgame_module(amalgame:'PropertyValueSelect').
+
+parameter(property, uri, '',
+	  'RDF property by which to select the concepts').
+parameter(value, uri, '',
+	  'RDF object/property value by which to select the concepts').
+
+% a bit naive at the moment: we simply change the query that should be
+% done.
+
+selecter(Scheme, and((Scheme), propvalue(Property, Value)), Options) :-
+	option(property(Property), Options),
+	option(value(Value), Options).
diff --git a/lib/amalgame/vocabulary.pl b/lib/amalgame/vocabulary.pl
index 4856cd8..f6094bf 100644
--- a/lib/amalgame/vocabulary.pl
+++ b/lib/amalgame/vocabulary.pl
@@ -26,6 +26,9 @@ vocab_member(E, type(Class)) :-
 vocab_member(E, graph(G)) :-
 	rdf(E, rdf:type, _, G).
 
+vocab_member(E, propvalue(Property, Value)) :-
+	rdf(E, Property, Value).
+
 vocab_member(F, 'http://sws.geonames.org/') :-
 	!,
 	rdfs_individual_of(F, 'http://www.geonames.org/ontology#Feature').
diff --git a/rdf/tool/ag_modules.ttl b/rdf/tool/ag_modules.ttl
index 9b2a83a..7b81436 100644
--- a/rdf/tool/ag_modules.ttl
+++ b/rdf/tool/ag_modules.ttl
@@ -99,6 +99,11 @@ amalgame:TypeSelect
     skos:definition "Select from a vocabulary the concepts of a specific type."@en ;
     rdfs:subClassOf amalgame:VocabSelecter .
 
+amalgame:PropertyValueSelect
+    rdfs:label "property/value"@en ;
+    skos:definition "Select from a vocabulary the concepts property/value."@en ;
+    rdfs:subClassOf amalgame:VocabSelecter .
+
 amalgame:OverlapComponent
     rdfs:label "overlap"@en ;
     skos:definition "Component that analyzes a set of mappings by creating intersections and differences sets"@en ;