From f641c028cf554d207c2c9a31e9ccba910c4ca4bc Mon Sep 17 00:00:00 2001
From: alvaro <alvaro@alia.(none)>
Date: Tue, 21 Feb 2012 08:18:39 -0800
Subject: [PATCH] Removed main.query and switched to sp.query and po.query

Improved default view type.rdfs:Resource
---
 .../html.queries/main.query                   | 18 ------
 .../type.rdfs:Resource/html.queries/po.query  |  9 +++
 .../type.rdfs:Resource/html.queries/sp.query  |  9 +++
 static/css/basic.css                          |  4 +-
 views/type.rdfs:Resource/html.template        | 55 ++++++++++---------
 5 files changed, 48 insertions(+), 47 deletions(-)
 delete mode 100644 models/type.rdfs:Resource/html.queries/main.query
 create mode 100644 models/type.rdfs:Resource/html.queries/po.query
 create mode 100644 models/type.rdfs:Resource/html.queries/sp.query

diff --git a/models/type.rdfs:Resource/html.queries/main.query b/models/type.rdfs:Resource/html.queries/main.query
deleted file mode 100644
index 2f315c7c..00000000
--- a/models/type.rdfs:Resource/html.queries/main.query
+++ /dev/null
@@ -1,18 +0,0 @@
-SELECT ?s2 ?p2 ?s1 ?p1  WHERE {
-{
-GRAPH ?g{
-        {
-                <{{uri}}> ?s1 ?p1 .
-        }UNION{
-                ?s2 ?p2 <{{uri}}> .
-
-        }
-}
-}UNION{        {
-                <{{uri}}> ?s1 ?p1 .
-        }UNION{
-                ?s2 ?p2 <{{uri}}> .
-
-        }
-}
-}
diff --git a/models/type.rdfs:Resource/html.queries/po.query b/models/type.rdfs:Resource/html.queries/po.query
new file mode 100644
index 00000000..f573aab3
--- /dev/null
+++ b/models/type.rdfs:Resource/html.queries/po.query
@@ -0,0 +1,9 @@
+SELECT ?p ?o  WHERE {
+  {
+    GRAPH ?g{
+                <{{uri}}> ?p ?o.
+    }
+  }UNION{     
+                <{{uri}}> ?p ?o .
+  }
+}
diff --git a/models/type.rdfs:Resource/html.queries/sp.query b/models/type.rdfs:Resource/html.queries/sp.query
new file mode 100644
index 00000000..3b5b69fb
--- /dev/null
+++ b/models/type.rdfs:Resource/html.queries/sp.query
@@ -0,0 +1,9 @@
+SELECT ?s ?p  WHERE {
+  {
+    GRAPH ?g{
+                ?s ?p <{{uri}}> .
+    }
+  }UNION{     
+                ?s ?p <{{uri}}> .
+  }
+}
diff --git a/static/css/basic.css b/static/css/basic.css
index b44283a4..026c093d 100644
--- a/static/css/basic.css
+++ b/static/css/basic.css
@@ -3,7 +3,7 @@ body {
 }
 
 h1{
-  font-size: 45px;
+  font-size: 24px;
 }
 
 h1,h2,body {
@@ -29,9 +29,7 @@ a:hover{
 
 
 table tr td {
-    border-width: thin;
 	padding: 2px;
-	border-style: dotted;
 	border-color: gray;
 	background-color: white;
 }
diff --git a/views/type.rdfs:Resource/html.template b/views/type.rdfs:Resource/html.template
index 6b5a78bd..7639943f 100644
--- a/views/type.rdfs:Resource/html.template
+++ b/views/type.rdfs:Resource/html.template
@@ -12,40 +12,43 @@
     <link rel="alternate" type="application/json" title="RDFJSON Version" href="{{lodspk.this.value}}.json" />
   </head>
   <body about="{{lodspk.this.value}}">
-    <h1>Page about <a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></h1>
-  {{lodspk.endpoint.local}}
-    <div>
-    <h2>Information from {{lodspk.this.curie}}</h2>
+    <h1>Default view</h1>
+
+    <div style='margin-top: 40px'>
     <table>
-    {% for row in models.main %}
+    <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>
 
-      {% if row.s1%}
-      <tr>
-        <td><a href='{{row.s1.value}}'>{{row.s1.curie}}</a></td>
+        </tr>
+    {% endfor %}
+<tr><td></td><td><a href='{{lodspk.this.value}}'>{{lodspk.this.curie}}</a></td><td></td></tr>
 
-        {% if row.p1.uri == 1 %}
-        <td><a rel='{{row.s1.curie}}' href='{{row.p1.value}}'>{{row.p1.curie}}</a></td>
-        {% else %}
-        <td><span property='{{row.s1.curie}}'>{{row.p1.value}}</span></td>
-        {% endif %}
+    {% 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>
-      {% endif %}
     {% endfor %}
-    </table>
+    <tr><th>Subject</th><th>Predicate</th><th>Object</th></tr>
 
-    <br/><br/>
-    <h2>Information pointing to {{lodspk.this.curie}}</h2>
-    <table>
-    {% for row in models.main %}
-      {% if row.s2%}
-     <tr>
-        <td><a href='{{row.s2.value}}'>{{row.s2.curie}}</a></td>
-        <td><a rev='[{{row.p2.curie}}]' href='{{row.s2.value}}'>{{row.p2.curie}}</a></td>
-    </tr>
-    {%endif %}
-    {% endfor %}
     </table>
     </div>
+    </div>
+    
+    
+    <br/>
   </body>
 </html>
-- 
GitLab