swish/commit
Updated example structures, removing old stuff
author | Jan Wielemaker |
---|---|
Fri Oct 16 10:29:56 2015 +0200 | |
committer | Jan Wielemaker |
Fri Oct 16 10:29:56 2015 +0200 | |
commit | fe868e0c95dcf7754f328592d20ae2cb01be7bf9 |
tree | 7f7df88f6d2a3160474a3234354ec05a07a40539 |
parent | c8d7d3eddb28f70e55f1d5b68ff1bc7c952a2c33 |
Diff style: patch stat
diff --git a/examples/index.json b/examples/index.json index 0fbe5c8..52a8ba0 100644 --- a/examples/index.json +++ b/examples/index.json @@ -1,10 +1,6 @@ // list of examples, represented as a JSON list [ -{ "file":"examples.swinb", "title":"Examples" }, -"--", -{ "file":"rdf_queries.pl", "title":"General queries" }, -{ "file":"rdf_literal.pl", "title":"Queries on literals" }, -{ "file":"rdf_update.pl", "title":"Update queries" }, -{ "file":"maintenance.pl", "title":"Maintenance queries" } +{ "file":"rdf_examples.swinb", "title":"RDF Examples" }, +"--" ] diff --git a/examples/maintenance.pl b/examples/maintenance.pl deleted file mode 100644 index bd289aa..0000000 --- a/examples/maintenance.pl +++ /dev/null @@ -1,32 +0,0 @@ -% Below are some queries to maintain an RDF database - -%% undefined_predicate(?P) is nondet. -% -% True when P refers to an RDF predicate that has no properties. - -undefined_predicate(P) :- - rdf_current_predicate(P), - ( rdf(_,P,_) - -> \+ rdf(P,_,_) - ). - -%% undefined_class(?Class) is nondet. -% -% True when P refers to an RDF class that has no properties. - -undefined_class(Class) :- - distinct(Class, rdf_has(_, rdf:type, Class)), - \+ rdf(Class, _, _). - - -%% lod_load(Resource) - -lod_load(Resource) :- - catch(rdf_load(Resource), E, print_message(warning, E)). - - -/** <examples> - -?- undefined_predicate(P). -?- undefined_class(C). -*/ diff --git a/examples/examples.swinb b/examples/rdf_examples.swinb similarity index 100% rename from examples/examples.swinb rename to examples/rdf_examples.swinb diff --git a/examples/rdf_literal.pl b/examples/rdf_literal.pl deleted file mode 100644 index 595a045..0000000 --- a/examples/rdf_literal.pl +++ /dev/null @@ -1,34 +0,0 @@ -% This file shows demo queries that you can use for more advanced -% queries on literals. - -% NOTE: Literal representation is under discussion. We are planning to -% move to the Turtle/SPARQL notation "string"@lang and "42"^^xsd:integer -% and use the value-space internally for supported types. We are working -% on the details and work out a smooth transition process. - -/** <examples> - -% Direct match - -?- rdf(S,P,literal(type(xsd:integer, 42))). -?- rdf(S,P,literal(lang(Lang, 'Amsterdam'))). - -% search - -?- rdf(S,P,literal(prefix(a), L)). -?- rdf(S,P,literal(between('1920','1940'), type(xsd:integer, V))). - -% full text search - -?- rdf_find_literals(problem, Literals), - member(Literal, Literals), - rdf(S,P,literal(Literal)). - -?- rdf_find_literals(stem(walking), Literals). - -% language operations - -?- lang_equal('EN.gb', 'en.gb'). -?- lang_matches('EN.bg', 'en'). - -*/ diff --git a/examples/rdf_queries.pl b/examples/rdf_queries.pl deleted file mode 100644 index 6ab6f5b..0000000 --- a/examples/rdf_queries.pl +++ /dev/null @@ -1,30 +0,0 @@ -% This file only contains example queries that can be fired -% directly on any RDF dataset. - -/** <examples> - -% basic triples - -?- rdf(S,P,O). -?- rdf(S,rdf:type,O). -?- rdf_has(S,dc:creator,C). - -% Searches - -?- rdf(C, rdf:type, rdfs:'Class'), rdf_reachable(S, rdfs:subClassOf, C). -?- rdf(S, rdfs:label, literal(prefix(a), L)). - -% enumerate instances - -?- rdf_graph(Graph). -?- rdf_current_predicate(P). -?- rdf_current_literal(L). -?- rdf_resource(R). - -% information - -?- rdf_statistics(triples(Triples)). -?- rdf_current_prefix(Prefix, URI). -?- rdf_predicate_property(Predicate, Property). -?- rdf_graph_property(Graph, Property). -*/ diff --git a/examples/rdf_update.pl b/examples/rdf_update.pl deleted file mode 100644 index 3ae4a17..0000000 --- a/examples/rdf_update.pl +++ /dev/null @@ -1,29 +0,0 @@ -% This file contains example queries that you can use to modify the -% triple store. These only work if you are logged on with administrative -% rights to ClioPatria. - -/** <examples> - -% Prefix handling - -?- rdf_register_prefix(ex, 'http://www.example.com/'). -?- rdf_equal(foaf:'Person', X), writeln(X). - -% Assert triples - -?- forall((rdf(S, rdfs:subClassOf, O), rdf(O, rdfs:subClassOf, O2)), - rdf_assert(S, rdfs:subClassOf, O2, my_entailments)). -?- rdf_statistics(triples_by_graph(my_entailments, Count)). -?- rdf_generation(Generation). - -% Remove triples - -?- rdf_retractall(S, P, literal(lang(fr,L))). -?- rdf_retractall(_,_,_,my_entailments). - -% Graph and data manipulation - -?- rdf_load('http://www.w3.org/2000/01/rdf-schema'). -?- rdf_unload_graph('http://www.w3.org/2000/01/rdf-schema'). -?- rdf_make. -*/