amalgame/commit
DELETED: unused (?) http_data_voc HTTP API
author | Jacco van Ossenbruggen |
---|---|
Sat Aug 30 10:12:43 2014 +0200 | |
committer | Jacco van Ossenbruggen |
Sat Aug 30 10:12:43 2014 +0200 | |
commit | 278ebed2931c040bfd2cddf561610efa68a09527 |
tree | 25d2b0757f2dfc3382cb8d961ebd2d279f3917d1 |
parent | d1d445eb19a64927df15832633a1c6b0a6ba6d25 |
Diff style: patch stat
diff --git a/api/mappinglist.pl b/api/mappinglist.pl index d97ce7a..a2f787b 100644 --- a/api/mappinglist.pl +++ b/api/mappinglist.pl @@ -2,20 +2,12 @@ [ ]). -:- use_module(library(semweb/rdf_db)). % for rdf_meta +:- use_module(library(semweb/rdf_db)). :- use_module(library(http/http_dispatch)). :- use_module(library(http/http_parameters)). :- use_module(library(http/http_json)). -:- use_module(library(count)). :- use_module(library(semweb/rdf_label)). -:- use_module(library(amalgame/util)). -:- use_module(library(amalgame/rdf_util)). -:- use_module(library(amalgame/vocabulary)). -:- use_module(library(amalgame/voc_stats)). -:- use_module(library(amalgame/expand_graph)). - -:- http_handler(amalgame(data/voc), http_data_voc, []). :- http_handler(amalgame(data/mappinglist), http_mapping_list, []). %% http_mapping_list(+Request) @@ -25,8 +17,10 @@ http_mapping_list(Request) :- http_parameters(Request, - [ strategy(Strategy, [description('URL of strategy')]), - status(Status, [default(finalized)]) + [ strategy(Strategy, + [description('URL of strategy')]), + status(Status, + [default(finalized)]) ]), Obj = json([uri=URI, label=Label]), findall(Obj, mapping_in_strategy(Strategy, URI, Label, [status(Status)]), Mappings), @@ -39,47 +33,3 @@ mapping_in_strategy(Strategy, MappingId, Label, Options) :- ; true ), rdf_display_label(MappingId, Label). - - -http_data_voc(Request) :- - setting(amalgame:rows_per_page, RowsPerPage), - http_parameters(Request, - [ url(URL, - [description('URL of scheme or vocabulary')]), - strategy(Strategy, [description('URL of strategy')]), - limit(Limit, - [default(RowsPerPage), number, - description('limit number of concepts returned')]), - offset(Offset, - [default(0), number, - description('first result that is returned')]) - ]), - expand_node(Strategy, URL, Scheme), - voc_property(URL, numberOfConcepts(Count)), - Max is Limit + Offset, - answer_set(C, vocab_member(C, Scheme), Max, Concepts), - - list_offset(Concepts, Offset, COffset), - list_limit(COffset, Limit, CLimit, _), - maplist(concept_data,CLimit, RichConcepts), - reply_json(json([url=URL, - limit=Limit, - offset=Offset, - concepts=json(RichConcepts), - total=Count])). - - -concept_data(Concept, Concept=json(Data)) :- - findall(Prop, concept_prop(Concept, Prop), DataS), - sort(DataS, Data). - -concept_prop(C, prefLabel=L) :- - rdf_lang(C, skos:prefLabel, L). - -concept_prop(C, altLabel=L) :- - rdf_lang(C, skos:altLabel, L). - -concept_prop(C, example=L) :- - rdf_has(C, skos:example, L). - -