From 7bcb8bda6cff4a389c5fc0811bef2d6834bffae2 Mon Sep 17 00:00:00 2001 From: alvaro <alvaro@alia.(none)> Date: Mon, 12 Mar 2012 12:19:29 -0700 Subject: [PATCH] Added components at installation time --- .../originalComponents/includes/header.inc | 5 ++ .../services/classes/html.template | 19 +++++++ .../services/classes/queries/main.query | 12 +++++ .../instances/html.queries/main.query | 13 +++++ .../services/instances/html.template | 19 +++++++ .../services/namedGraphs/html.template | 19 +++++++ .../services/namedGraphs/queries/main.query | 6 +++ .../types/rdfs:Resource/html.template | 52 +++++++++++++++++++ .../types/rdfs:Resource/queries/po.query | 9 ++++ .../types/rdfs:Resource/queries/sp.query | 9 ++++ install.sh | 3 +- 11 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 doc/examples/originalComponents/includes/header.inc create mode 100644 doc/examples/originalComponents/services/classes/html.template create mode 100644 doc/examples/originalComponents/services/classes/queries/main.query create mode 100644 doc/examples/originalComponents/services/instances/html.queries/main.query create mode 100644 doc/examples/originalComponents/services/instances/html.template create mode 100644 doc/examples/originalComponents/services/namedGraphs/html.template create mode 100644 doc/examples/originalComponents/services/namedGraphs/queries/main.query create mode 100644 doc/examples/originalComponents/types/rdfs:Resource/html.template create mode 100644 doc/examples/originalComponents/types/rdfs:Resource/queries/po.query create mode 100644 doc/examples/originalComponents/types/rdfs:Resource/queries/sp.query diff --git a/doc/examples/originalComponents/includes/header.inc b/doc/examples/originalComponents/includes/header.inc new file mode 100644 index 00000000..2c90255a --- /dev/null +++ b/doc/examples/originalComponents/includes/header.inc @@ -0,0 +1,5 @@ +<h4>Endpoint: {{lodspk.endpoint.local}}</h4> +<div style='float:center'> +<a href='{{lodspk.home}}'>Home</a> | <a href='{{lodspk.home}}classes'>Classes</a> | <a href='{{lodspk.home}}namedGraphs'>Named Graphs</a> +</div> + diff --git a/doc/examples/originalComponents/services/classes/html.template b/doc/examples/originalComponents/services/classes/html.template new file mode 100644 index 00000000..b93ea0f5 --- /dev/null +++ b/doc/examples/originalComponents/services/classes/html.template @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" + "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in lodspk.ns %}xmlns:{{i}}="{{ns}}" + {%endfor%}version="XHTML+RDFa 1.0" xml:lang="en"> + <head> + <title>My new Service</title> + <link href="css/basic.css" rel="stylesheet" type="text/css" media="screen" /> + </head> + <body> + <h1>Classes available</h1> +{%include "../../includes/header.inc"%} + <ul> + {% for row in models.main %} + <li><a href="{{lodspk.baseUrl}}instances/{{ row.resource.curie }}">{{row.resource.curie}}</a></li> + {% endfor %} + </ul> + </body> +</html> diff --git a/doc/examples/originalComponents/services/classes/queries/main.query b/doc/examples/originalComponents/services/classes/queries/main.query new file mode 100644 index 00000000..0157430d --- /dev/null +++ b/doc/examples/originalComponents/services/classes/queries/main.query @@ -0,0 +1,12 @@ +{%for h in base.header %} +PREFIX {{h.prefix}}: <{{h.ns}}> +{%endfor%} +SELECT DISTINCT ?resource WHERE { + { + {%if base.args.arg0 %}GRAPH <{{base.args.arg0}}>{%else%} GRAPH ?g {%endif%} { + ?x a ?resource . + } + }UNION{ + ?x a ?resource . + } +}order by ?resource diff --git a/doc/examples/originalComponents/services/instances/html.queries/main.query b/doc/examples/originalComponents/services/instances/html.queries/main.query new file mode 100644 index 00000000..a93cf367 --- /dev/null +++ b/doc/examples/originalComponents/services/instances/html.queries/main.query @@ -0,0 +1,13 @@ +{%for h in lodspk.header %} +PREFIX {{h.prefix}}: <{{h.ns}}> +{%endfor%} +SELECT DISTINCT ?resource WHERE { + { + GRAPH ?g{ + ?resource a {{lodspk.args.arg0}} + } + }UNION{ + ?resource a {{lodspk.args.arg0}} + } +}order by ?resource +limit 1000 diff --git a/doc/examples/originalComponents/services/instances/html.template b/doc/examples/originalComponents/services/instances/html.template new file mode 100644 index 00000000..1dc603e1 --- /dev/null +++ b/doc/examples/originalComponents/services/instances/html.template @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" + "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in base.ns %}xmlns:{{i}}="{{ns}}" + {%endfor%}version="XHTML+RDFa 1.0" xml:lang="en"> + <head> + <title>Instances of {{lodspk.args.arg0}}</title> + <link href="../css/basic.css" rel="stylesheet" type="text/css" media="screen" /> + </head> + <body> + <h1>Instances of class {{lodspk.args.arg0}}</h1> +{%include "../../includes/header.inc"%} + <ul> + {% for row in models.main %} + <li><a href="{{ row.resource.value }}">{{row.resource.curie}}</a></li> + {% endfor %} + </ul> + </body> +</html> diff --git a/doc/examples/originalComponents/services/namedGraphs/html.template b/doc/examples/originalComponents/services/namedGraphs/html.template new file mode 100644 index 00000000..e6109aef --- /dev/null +++ b/doc/examples/originalComponents/services/namedGraphs/html.template @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" + "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in base.ns %}xmlns:{{i}}="{{ns}}" + {%endfor%}version="XHTML+RDFa 1.0" xml:lang="en"> + <head> + <title>Named Graphs</title> + <link href="css/basic.css" rel="stylesheet" type="text/css" media="screen" /> + </head> + <body> + <h1>Named graphs available</h1> +{%include "../../includes/header.inc"%} + <ul> + {% for row in models.main %} + <li>{{row.g.value}}</li> + {% endfor %} + </ul> + </body> +</html> diff --git a/doc/examples/originalComponents/services/namedGraphs/queries/main.query b/doc/examples/originalComponents/services/namedGraphs/queries/main.query new file mode 100644 index 00000000..c0ec090e --- /dev/null +++ b/doc/examples/originalComponents/services/namedGraphs/queries/main.query @@ -0,0 +1,6 @@ +SELECT DISTINCT ?g WHERE { + GRAPH ?g{ + [] ?p ?resource . + } +} + order by ?g diff --git a/doc/examples/originalComponents/types/rdfs:Resource/html.template b/doc/examples/originalComponents/types/rdfs:Resource/html.template new file mode 100644 index 00000000..7dd111f2 --- /dev/null +++ b/doc/examples/originalComponents/types/rdfs:Resource/html.template @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" + "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" {% for i, ns in lodspk.ns %}xmlns:{{i}}="{{ns}}" + {%endfor%}version="XHTML+RDFa 1.0" xml:lang="en"> + <head> + <title>Page about {{lodspk.this.value}}</title> + <link href="{{lodspk.home}}css/basic.css" rel="stylesheet" type="text/css" media="screen" /> + <link rel="alternate" type="application/rdf+xml" title="RDF/XML Version" href="{{lodspk.this.value}}.rdf" /> + <link rel="alternate" type="text/turtle" title="Turtle Version" href="{{lodspk.this.value}}.ttl" /> + <link rel="alternate" type="text/plain" title="N-Triples Version" href="{{lodspk.this.value}}.nt" /> + <link rel="alternate" type="application/json" title="RDFJSON Version" href="{{lodspk.this.value}}.json" /> + </head> + <body about="{{lodspk.this.value}}"> + <h1>Default view</h1> + + <div style='margin-top: 40px'> + <table> + <tr><th>Subject</th><th>Predicate</th><th>Object</th></tr> + {% for row in models.po %} + <tr> +<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td> + <td style='background-color:#c9f9c9'><a href='{{row.p.value}}'>{{row.p.curie}}</a></td> + + <td style='background-color:#c9f9c9'> + {%if row.o.uri == 1%} + <a rev='[{{row.p.curie}}]' href='{{row.o.value}}'>{{row.o.curie}}</a> + {%else%} + {{row.o.value}} + {%endif%} + </td> + + </tr> + {% endfor %} +<tr><td></td><td><a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></td><td></td></tr> + + {% for row in models.sp %} + <tr> + <td style='background-color:#c9f9c9'><a href='{{row.s.value}}'>{{row.s.curie}}</a></td> + + <td style='background-color:#c9f9c9'><a rel='{{row.s.curie}}' href='{{row.p.value}}'>{{row.p.curie}}</a></td> +<td>{%if forloop.first%}<a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a>{%endif%}</td> + </tr> + {% endfor %} + <tr><th>Subject</th><th>Predicate</th><th>Object</th></tr> + + </table> + </div> + + <br/> + </body> +</html> diff --git a/doc/examples/originalComponents/types/rdfs:Resource/queries/po.query b/doc/examples/originalComponents/types/rdfs:Resource/queries/po.query new file mode 100644 index 00000000..f573aab3 --- /dev/null +++ b/doc/examples/originalComponents/types/rdfs:Resource/queries/po.query @@ -0,0 +1,9 @@ +SELECT ?p ?o WHERE { + { + GRAPH ?g{ + <{{uri}}> ?p ?o. + } + }UNION{ + <{{uri}}> ?p ?o . + } +} diff --git a/doc/examples/originalComponents/types/rdfs:Resource/queries/sp.query b/doc/examples/originalComponents/types/rdfs:Resource/queries/sp.query new file mode 100644 index 00000000..3b5b69fb --- /dev/null +++ b/doc/examples/originalComponents/types/rdfs:Resource/queries/sp.query @@ -0,0 +1,9 @@ +SELECT ?s ?p WHERE { + { + GRAPH ?g{ + ?s ?p <{{uri}}> . + } + }UNION{ + ?s ?p <{{uri}}> . + } +} diff --git a/install.sh b/install.sh index e08428cf..46426a30 100755 --- a/install.sh +++ b/install.sh @@ -118,7 +118,8 @@ echo "RewriteRule ^\$ $1/index.php [L]" >> $parent_htaccess cat $root_htaccess >> $parent_htaccess echo "RewriteRule ^(.+)\$ $1/index.php?q=\$1 [L]" >> $parent_htaccess mkdir cache - +cp -r doc/examples/originalComponents components +mkdir -p components/uris echo echo " *** ATTENTION ***" -- GitLab