Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the last version so far #2

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
55,080 changes: 55,080 additions & 0 deletions output/2005-2006_cultural_facilities.ttl

Large diffs are not rendered by default.

78,624 changes: 78,624 additions & 0 deletions output/2005-2008_green_space.ttl

Large diffs are not rendered by default.

11,016 changes: 11,016 additions & 0 deletions output/2005-2012_traffic_equipment.ttl

Large diffs are not rendered by default.

68,136 changes: 68,136 additions & 0 deletions output/2007-2008_cultural_facilities.ttl

Large diffs are not rendered by default.

75,480 changes: 75,480 additions & 0 deletions output/2009-2010_cultural_facilities.ttl

Large diffs are not rendered by default.

82,440 changes: 82,440 additions & 0 deletions output/2009-2012_green_space.ttl

Large diffs are not rendered by default.

76,704 changes: 76,704 additions & 0 deletions output/2011-2012_cultural_facilities.ttl

Large diffs are not rendered by default.

19,980 changes: 19,980 additions & 0 deletions output/2011-2012_place_of_a_crime.ttl

Large diffs are not rendered by default.

42,432 changes: 42,432 additions & 0 deletions output/2011-2013_highschool.ttl

Large diffs are not rendered by default.

223 changes: 223 additions & 0 deletions output/pluqi-schema-final.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
@prefix : <http://project.dapaas.eu/pluqi/schema/> .
@prefix ad: <http://lod.seoul.go.kr/def/ad/> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://project.dapaas.eu/pluqi/schema> .

<http://project.dapaas.eu/pluqi/schema> rdf:type owl:Ontology .


#################################################################
#
# Object Properties
#
#################################################################


### http://project.dapaas.eu/pluqi/schema/from

:from rdf:type owl:ObjectProperty ;

rdfs:range :DataSource ;

rdfs:domain :Value .



### http://project.dapaas.eu/pluqi/schema/hasValue

:hasValue rdf:type owl:ObjectProperty ;

rdfs:domain :Quality_Index ;

rdfs:range :Value .



### http://project.dapaas.eu/pluqi/schema/location

:location rdf:type owl:ObjectProperty ;

rdfs:range :Location ;

rdfs:domain :Value .





#################################################################
#
# Data properties
#
#################################################################


### http://project.dapaas.eu/pluqi/schema/measure

:measure rdf:type owl:DatatypeProperty ;

rdfs:domain :Value .



### http://project.dapaas.eu/pluqi/schema/time

:time rdf:type owl:DatatypeProperty ;

rdfs:domain :Value ;

rdfs:range xsd:dateTimeStamp ;

rdfs:subPropertyOf owl:topDataProperty .



### http://www.w3.org/2003/01/geo/wgs84_pos#lat

geo:lat rdf:type owl:DatatypeProperty ;

rdfs:domain :Location ;

rdfs:range xsd:double ;

rdfs:subPropertyOf owl:topDataProperty .



### http://www.w3.org/2003/01/geo/wgs84_pos#long

geo:long rdf:type owl:DatatypeProperty ;

rdfs:domain :Location ;

rdfs:range xsd:double ;

rdfs:subPropertyOf owl:topDataProperty .





#################################################################
#
# Classes
#
#################################################################


### http://lod.seoul.go.kr/def/ad/Si

ad:Si rdf:type owl:Class ;

rdfs:label "City"^^xsd:string ;

rdfs:subClassOf <http://lod.seoul.go.kr/page/def/ad/KoreaAdministrativeDivisions> ;

rdfs:seeAlso "<http://lod.seoul.go.kr/def/ad/Si>"^^xsd:anyURI .



### http://lod.seoul.go.kr/page/def/ad/KoreaAdministrativeDivisions

<http://lod.seoul.go.kr/page/def/ad/KoreaAdministrativeDivisions> rdf:type owl:Class ;

rdfs:subClassOf :Location .



### http://project.dapaas.eu/pluqi/schema/Cultural_satisfaction

:Cultural_satisfaction rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Daily_life_satisfaction

:Daily_life_satisfaction rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/DataSource

:DataSource rdf:type owl:Class .



### http://project.dapaas.eu/pluqi/schema/Environmental_needs_and_efficiency

:Environmental_needs_and_efficiency rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Financial_satisfaction

:Financial_satisfaction rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Healthcare_Level

:Healthcare_Level rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Level_of_opportunity

:Level_of_opportunity rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Location

:Location rdf:type owl:Class .



### http://project.dapaas.eu/pluqi/schema/Political_satisfaction

:Political_satisfaction rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Quality_Index

:Quality_Index rdf:type owl:Class .



### http://project.dapaas.eu/pluqi/schema/Safety_and_security

:Safety_and_security rdf:type owl:Class ;

rdfs:subClassOf :Quality_Index .



### http://project.dapaas.eu/pluqi/schema/Value

:Value rdf:type owl:Class .




### Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net

21 changes: 16 additions & 5 deletions src/pluqi_transformation/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,32 @@
(concat (drop-last 2 (take-last 3 (:column-names new-data)))
(drop-last 3 (:column-names new-data))))))

(defn apply-pipeline [path]
(defn apply-pipeline [path pipeline-name]
(-> (open-all-datasets path :metadata-fn prepend-file-metadata)
first
pipeline))
(pipeline pipeline-name)))

(defn apply-complete-transformation [path]
(-> (apply-pipeline path)
(defn apply-complete-transformation [path pipeline-name]
(-> (apply-pipeline path pipeline-name)
make-graph))

;(defn -main [& [path output pipeline-name]]
; (when-not (and path output)
; (println "Usage: lein run <input-file.csv> <output-file.(nt|rdf|n3|ttl)
; <pipeline-name (c:cultural facilities | t:traffic equipment | g:green space | h:highschool | p:place of a crime)>")
; (System/exit 0))
;
; (-> (apply-complete-transformation path pipeline-name)
; (import-data output))
;
; (println path "=>" output))

(defn -main [& [path output]]
(when-not (and path output)
(println "Usage: lein run <input-file.csv> <output-file.(nt|rdf|n3|ttl)>")
(System/exit 0))

(-> (apply-complete-transformation path)
(-> (apply-complete-transformation path "p")
(import-data output))

(println path "=>" output))
20 changes: 10 additions & 10 deletions src/pluqi_transformation/graph.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
[grafter.rdf.ontologies.qb :refer :all]
[grafter.rdf.ontologies.os :refer :all]
[grafter.rdf.ontologies.sdmx-measure :refer :all]
[pluqi-transformation.prefix :refer [pluqi-graph pluqi-vocab base-vocab base-data resource-id]]))

;[pluqi-transformation.prefix :refer [pluqi-graph pluqi-vocab base-vocab base-data resource-id]]))
[pluqi-transformation.prefix :refer [pluqi-graph pluqi-schema pluqi-data]]))

(def make-graph
(graph-fn [{:keys [variable value year dataset-uri dimension-uri
Expand All @@ -23,18 +23,18 @@
[dimension-uri
[rdf:a indicator-uri]
[rdf:a (owl "NamedIndividual")]
[(pluqi-vocab "hasValue") observation-uri]]
[(pluqi-schema "hasValue") observation-uri]]

[observation-uri
[rdf:a (owl "NamedIndividual")]
[rdf:a (pluqi-vocab "Value")]
[rdf:a (pluqi-schema "Value")]
[rdfs:label (s observation-label :en)]
[(pluqi-vocab "measure") value]
[(pluqi-vocab "location") division-uri]
[(pluqi-vocab "hasValue") dataset-uri]
[(pluqi-vocab "time") observation-date]
[rdfs:comment (s type :en)]]
[(pluqi-schema "measure") value]
[(pluqi-schema "location") division-uri]
[(pluqi-schema "hasValue") dataset-uri]
[(pluqi-schema "time") observation-date]]
;[rdfs:comment (s type :en)]

[dataset-uri
[rdf:a (pluqi-vocab "DataSource")]
[rdf:a (pluqi-schema "DataSource")]
[rdf:a (owl "NamedIndividual")]])))
Loading