Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement basic dereference of the requested resource
  • Loading branch information
Jochen Rau committed May 14, 2012
1 parent 9389292 commit 5d4a14c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
27 changes: 17 additions & 10 deletions resources/private/data/abox.ttl
Expand Up @@ -21,16 +21,23 @@
@prefix knowl: <http://knowl-edge.org/ontology/core#> .
@prefix ex: <http://example.com/ontology#> .

<http://localhost/blog>
rdf:type bibo:Webpage ;
rdfs:label "Blog"@en ;
knowl:contains <urn:uuid:748fc789-6b8e-4628-a248-f563ec0482f5>, <urn:uuid:01da6567-6b5b-4596-a541-10db9459dda3> .

<http://localhost/products>
rdf:type bibo:Webpage ;
rdfs:label "Product Catalog"@en ;
ex:menu <urn:uuid:718c0bbe-a89a-4115-a9d8-3a8ada9ceeff> ;
knowl:contains <http://example.com/ACMECorp> .

<urn:uuid:16d041e0-16f0-4b2a-9150-3452e5b93286>
a knowl:Application .


<urn:uuid:75889010-c99a-46b5-a5cb-8300adb75b31>
knowl:represents <http://localhost/blog> ;
rdf:type bibo:Webpage ;
rdfs:label "Blog"@en ;
knowl:contains <urn:uuid:748fc789-6b8e-4628-a248-f563ec0482f5>, <urn:uuid:01da6567-6b5b-4596-a541-10db9459dda3> .

<urn:uuid:fe54a438-b924-447a-875c-2db010a8015f>
knowl:represents <http://localhost/products> ;
rdf:type bibo:Webpage ;
rdfs:label "Product Catalog"@en ;
ex:menu <urn:uuid:718c0bbe-a89a-4115-a9d8-3a8ada9ceeff> ;
knowl:contains <http://example.com/ACMECorp> .

<urn:uuid:748fc789-6b8e-4628-a248-f563ec0482f5>
rdf:type sioc:BlogPost ;
Expand Down
11 changes: 7 additions & 4 deletions src/knowl/edge/transformation.clj
Expand Up @@ -23,8 +23,10 @@
:author "Jochen Rau"}
knowl.edge.transformation
(:refer-clojure :exclude [namespace])
(:use knowl.edge.store
knowl.edge.model)
(:use
[clojure.contrib.core :only (-?>)]
knowl.edge.store
knowl.edge.model)
(:require
[clojure.contrib.str-utils2 :as string]
[clj-time.format :as time]
Expand Down Expand Up @@ -143,5 +145,6 @@
;; Entry Point

(defn dereference [resource]
(if-let [result (transform resource (Context. 0 []))]
(template/emit* result)))
(when-let [representation (-?> (find-matching store nil "http://knowl-edge.org/ontology/core#represents" (identifier resource)) first subject)]
(when-let [document (transform representation (Context. 0 []))]
(template/emit* document))))

0 comments on commit 5d4a14c

Please sign in to comment.