dowl 0.2 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +7 -3
- data/Rakefile +11 -40
- data/bin/dowl +0 -1
- data/examples/example.ttl +1 -1
- data/examples/example2.ttl +51 -0
- data/lib/dowl.rb +2 -0
- data/lib/dowl/assets/bootstrap.min.css +9 -0
- data/lib/dowl/assets/bootstrap.min.js +6 -0
- data/lib/dowl/assets/jquery.js +4 -0
- data/lib/dowl/class.rb +2 -2
- data/lib/dowl/default.erb +226 -150
- data/lib/dowl/generator.rb +11 -1
- data/lib/dowl/ontology.rb +2 -2
- data/lib/dowl/property.rb +4 -0
- data/lib/dowl/util.rb +6 -2
- data/tests/tc_schema.rb +18 -1
- metadata +53 -67
data/lib/dowl/generator.rb
CHANGED
@@ -15,7 +15,17 @@ module DOWL
|
|
15
15
|
return default_template_file = File.join(dir, "default.erb")
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
18
|
+
def copy_assets
|
19
|
+
asset_dir = File.join( File.dirname( __FILE__ ), "assets" )
|
20
|
+
Dir.new(asset_dir).each() do |file|
|
21
|
+
if file != "." and file != ".."
|
22
|
+
File.copy( File.join(asset_dir, file), Dir.pwd )
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def run()
|
28
|
+
copy_assets()
|
19
29
|
b = binding
|
20
30
|
schema = @schema
|
21
31
|
introduction = @introduction
|
data/lib/dowl/ontology.rb
CHANGED
data/lib/dowl/property.rb
CHANGED
data/lib/dowl/util.rb
CHANGED
@@ -23,7 +23,11 @@ module DOWL
|
|
23
23
|
def short_name()
|
24
24
|
uri = @resource.to_s
|
25
25
|
ontology_uri = @schema.ontology.uri
|
26
|
-
|
26
|
+
if ontology_uri.end_with?("#") || ontology_uri.end_with?("/")
|
27
|
+
ontology_uri = ontology_uri[0..-2]
|
28
|
+
end
|
29
|
+
name = uri.gsub(/#{ontology_uri}(\/|#)?/, "")
|
30
|
+
return name
|
27
31
|
end
|
28
32
|
|
29
33
|
def label()
|
@@ -35,7 +39,7 @@ module DOWL
|
|
35
39
|
end
|
36
40
|
|
37
41
|
def status()
|
38
|
-
return get_literal(DOWL::Namespaces::VS.
|
42
|
+
return get_literal(DOWL::Namespaces::VS.term_status)
|
39
43
|
end
|
40
44
|
|
41
45
|
def <=>(other)
|
data/tests/tc_schema.rb
CHANGED
@@ -21,8 +21,25 @@ class SchemaTest < Test::Unit::TestCase
|
|
21
21
|
classes = schema.classes()
|
22
22
|
assert_not_nil classes
|
23
23
|
assert_equal(2, classes.length)
|
24
|
+
|
25
|
+
c = classes["http://www.example.org/dowl/SomeClass"]
|
26
|
+
assert_equal("SomeClass", c.short_name)
|
27
|
+
assert_equal("http://www.example.org/dowl/SomeClass", c.uri)
|
28
|
+
|
24
29
|
end
|
25
|
-
|
30
|
+
|
31
|
+
def test_hash_uris()
|
32
|
+
file = "examples/example2.ttl"
|
33
|
+
schema = DOWL::Schema.create_from_file(File.expand_path(file))
|
34
|
+
classes = schema.classes()
|
35
|
+
assert_not_nil classes
|
36
|
+
assert_equal(1, classes.length)
|
37
|
+
c = classes.values[0]
|
38
|
+
assert_equal("SomeClass", c.short_name)
|
39
|
+
assert_equal("http://www.example.org/dowl#SomeClass", c.uri)
|
40
|
+
end
|
41
|
+
|
42
|
+
|
26
43
|
def test_identify_owl_classes()
|
27
44
|
model = RDF::Graph.new()
|
28
45
|
model << RDF::Statement.new( RDF::URI.new("http://www.example.com/"), RDF.type, DOWL::Namespaces::OWL.Class)
|
metadata
CHANGED
@@ -1,64 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dowl
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: "0.2"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.5'
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Leigh Dodds
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: mocha
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 49
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 9
|
32
|
-
- 5
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.9.5
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rdf-raptor
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.9.5
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: linkeddata
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
40
33
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
- 4
|
48
|
-
- 0
|
49
|
-
version: 0.4.0
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.0'
|
50
38
|
type: :runtime
|
51
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
52
46
|
description: dowl OWL/RDF doc generator
|
53
|
-
email: leigh
|
54
|
-
executables:
|
47
|
+
email: leigh@ldodds.com
|
48
|
+
executables:
|
55
49
|
- dowl
|
56
50
|
extensions: []
|
57
|
-
|
58
|
-
extra_rdoc_files:
|
51
|
+
extra_rdoc_files:
|
59
52
|
- README
|
60
53
|
- CHANGES
|
61
|
-
files:
|
54
|
+
files:
|
62
55
|
- README
|
63
56
|
- Rakefile
|
64
57
|
- CHANGES
|
@@ -68,53 +61,46 @@ files:
|
|
68
61
|
- tests/tc_ontology.rb
|
69
62
|
- examples/example.ttl
|
70
63
|
- examples/introduction.html
|
64
|
+
- examples/example2.ttl
|
71
65
|
- lib/dowl.rb
|
72
66
|
- lib/dowl/property.rb
|
73
67
|
- lib/dowl/default.erb
|
74
68
|
- lib/dowl/util.rb
|
75
69
|
- lib/dowl/class.rb
|
70
|
+
- lib/dowl/assets/bootstrap.min.css
|
71
|
+
- lib/dowl/assets/jquery.js
|
72
|
+
- lib/dowl/assets/bootstrap.min.js
|
76
73
|
- lib/dowl/schema.rb
|
77
74
|
- lib/dowl/ontology.rb
|
78
75
|
- lib/dowl/generator.rb
|
79
|
-
has_rdoc: true
|
80
76
|
homepage: http://github.com/ldodds/dowl
|
81
77
|
licenses: []
|
82
|
-
|
83
78
|
post_install_message:
|
84
|
-
rdoc_options:
|
79
|
+
rdoc_options:
|
85
80
|
- --quiet
|
86
81
|
- --title
|
87
82
|
- dowl Reference
|
88
83
|
- --main
|
89
84
|
- README
|
90
|
-
require_paths:
|
85
|
+
require_paths:
|
91
86
|
- lib
|
92
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
88
|
none: false
|
94
|
-
requirements:
|
95
|
-
- -
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
hash: 61
|
98
|
-
segments:
|
99
|
-
- 1
|
100
|
-
- 8
|
101
|
-
- 5
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
102
92
|
version: 1.8.5
|
103
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
94
|
none: false
|
105
|
-
requirements:
|
106
|
-
- -
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
|
109
|
-
segments:
|
110
|
-
- 0
|
111
|
-
version: "0"
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
112
99
|
requirements: []
|
113
|
-
|
114
100
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.8.23
|
116
102
|
signing_key:
|
117
103
|
specification_version: 3
|
118
104
|
summary: dowl OWL/RDF doc generator
|
119
|
-
test_files:
|
105
|
+
test_files:
|
120
106
|
- tests/ts_dowl.rb
|