swish/commit
Updated examples to canonical representation
author | Jan Wielemaker |
---|---|
Fri Oct 16 10:27:36 2015 +0200 | |
committer | Jan Wielemaker |
Fri Oct 16 10:27:36 2015 +0200 | |
commit | c8d7d3eddb28f70e55f1d5b68ff1bc7c952a2c33 |
tree | 9bc1cf6e9b834daf828ee2ca1eaee9a8d1498026 |
parent | cce97bb5b2bd0d2349c0c8313139c3e702c39cdd |
Diff style: patch stat
diff --git a/examples/basic_graph_examples.swinb b/examples/basic_graph_examples.swinb index 2354c32..575d936 100644 --- a/examples/basic_graph_examples.swinb +++ b/examples/basic_graph_examples.swinb @@ -10,19 +10,19 @@ The core predicates of the RDF library are rdf/3 and rdf/4, using the signature If you run the query below by pressing the *play* button SWISH generates a table. The solutions are _rendered_ using the RDF renderer, which renders - - *resources* in abbreviated form, trying to show the _prefix_, followed + - *Resources* in abbreviated form, trying to show the _prefix_, followed by a label. The label is formed from `rdfs:label`, `skos:prefLabel`, etc., eventually using the _local name_. By *hovering over the top-left corner* of the result, the raw Prolog form can be requested, which is a Prolog atom representing the full IRI. - - *literals* are represented in their _Turtle_ representation. Again, + - *Literals* are represented in their _Turtle_ representation. Again, by hovering and selecting _Prolog term_, you can view the actual representation. Clicking a resource will open the ClioPatria _Local View_ on the resource. </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(S, P, O). </div> @@ -31,11 +31,11 @@ The rdf/3 and rdf/4 relations are _pure_, i.e., they behave completely logically `rdf:type` triples, we can use the query below. The _RDF_ prefix is defined using rdf_register_prefix/2, and therefore we can also abbreviate the query: </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(S, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', O). </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(S, rdf:type, O). </div> @@ -54,7 +54,7 @@ turn it into an _atom_; identifiers that start with a capital letter are Prolog _variables_. </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(S, rdf:type, C), rdf(C, rdfs:subClassOf, foaf:'Agent'). </div> @@ -72,7 +72,7 @@ foaf_agent_of_type(Agent, Type) :- rdf(Type, rdfs:subClassOf, foaf:'Agent'). </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> foaf_agent_of_type(Agent, Type). </div> diff --git a/examples/c3_examples.swinb b/examples/c3_examples.swinb index 64d8dfa..e2c6d0c 100644 --- a/examples/c3_examples.swinb +++ b/examples/c3_examples.swinb @@ -19,7 +19,11 @@ Below we show how the C3 renderer can be used to create a diagram on the distrib </div> <div class="nb-cell query"> -findall([Graph,Count], rdf_statistics(triples_by_graph(Graph,Count)), _Pairs), +findall(Graph-Count, + limit(10, + order_by([desc(Count)], + rdf_statistics(triples_by_graph(Graph,Count)))), + _Pairs), Chart = c3{data:_{columns:_Pairs, type:pie}}. </div> diff --git a/examples/literal_examples.swinb b/examples/literal_examples.swinb index 181700c..4e1a914 100644 --- a/examples/literal_examples.swinb +++ b/examples/literal_examples.swinb @@ -23,7 +23,7 @@ In addition to a simple direct match to a literal, rdf/3 and rdf/4 accept a quer like below. See rdf/3 for all possible specifications. The _prefix_, _ge_ and _between_ searches exploit the fact that all literals are stored in a binary tree. </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(S, P, literal(prefix('Jan'), Value)). </div> diff --git a/examples/prefix_examples.swinb b/examples/prefix_examples.swinb index ec1d5b2..b121633 100644 --- a/examples/prefix_examples.swinb +++ b/examples/prefix_examples.swinb @@ -11,7 +11,7 @@ A consequence of this is that prefixes cannot be defined if SWISH operates in an The currently known prefixes are easily enumerated: </div> -<div data-chunk="100" data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-chunk="100" data-tabled="true"> rdf_current_prefix(Prefix, IRI). </div> @@ -22,7 +22,7 @@ Prefix abbreviations can be inserted into arguments of the RDF API that expect a and not a Prolog _variable_. </div> -<div data-tabled="true" class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> rdf(P, rdf:type, foaf:'Person'). </div> @@ -97,7 +97,7 @@ rdf_global_id/2, which can both be used to create an atomic resource and to spli one into the prefix and local name. Note the rendering of `Resource` as an abbreviated link and the rendering of `Term` as an ordinary Prolog term. </div> -<div class="nb-cell query"> +<div class="nb-cell query" data-tabled="true"> Term = foaf:'Person', rdf_global_id(Term, Resource). </div>