publish_my_data 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/concerns/publish_my_data/data_download.rb +22 -0
- data/app/controllers/concerns/publish_my_data/resource_rendering.rb +40 -0
- data/app/controllers/concerns/publish_my_data/sparql_processing.rb +81 -0
- data/app/controllers/publish_my_data/datasets_controller.rb +5 -23
- data/app/controllers/publish_my_data/information_resources_controller.rb +26 -4
- data/app/controllers/publish_my_data/queries_controller.rb +1 -1
- data/app/controllers/publish_my_data/resources_controller.rb +5 -9
- data/app/controllers/publish_my_data/sparql_controller.rb +1 -1
- data/app/controllers/publish_my_data/vocabularies_controller.rb +18 -0
- data/app/models/concerns/publish_my_data/all_features.rb +79 -0
- data/app/models/concerns/publish_my_data/basic_features.rb +21 -0
- data/app/models/concerns/publish_my_data/dataset_powers.rb +130 -0
- data/{lib → app/models/concerns}/publish_my_data/defined_by_ontology.rb +5 -0
- data/app/models/publish_my_data/concept.rb +2 -2
- data/app/models/publish_my_data/concept_scheme.rb +31 -3
- data/app/models/publish_my_data/dataset.rb +2 -128
- data/app/models/publish_my_data/example_resource.rb +21 -0
- data/app/models/publish_my_data/ontology.rb +35 -6
- data/app/models/publish_my_data/ontology_class.rb +3 -5
- data/app/models/publish_my_data/property.rb +3 -5
- data/app/models/publish_my_data/rdf_type.rb +1 -2
- data/app/models/publish_my_data/resource.rb +25 -96
- data/app/models/publish_my_data/theme.rb +1 -3
- data/app/models/publish_my_data/third_party/concept_scheme.rb +30 -0
- data/app/models/publish_my_data/third_party/ontology.rb +30 -0
- data/app/models/publish_my_data/vocabulary.rb +22 -0
- data/app/views/publish_my_data/classes/show.html.erb +3 -0
- data/app/views/publish_my_data/concept_schemes/_concepts.html.erb +18 -3
- data/app/views/publish_my_data/concept_schemes/show.html.erb +3 -1
- data/app/views/publish_my_data/concepts/show.html.erb +3 -3
- data/app/views/publish_my_data/datasets/show.html.erb +2 -2
- data/app/views/publish_my_data/ontologies/show.html.erb +6 -6
- data/app/views/publish_my_data/properties/show.html.erb +3 -3
- data/app/views/publish_my_data/resources/_summaries.html.erb +18 -0
- data/app/views/publish_my_data/resources/show.html.erb +3 -3
- data/config/routes.rb +8 -4
- data/lib/publish_my_data.rb +14 -5
- data/lib/publish_my_data/engine.rb +3 -0
- data/lib/publish_my_data/version.rb +1 -1
- data/spec/controllers/publish_my_data/datasets_controller_spec.rb +3 -3
- data/spec/controllers/publish_my_data/information_resources_controller_spec.rb +158 -104
- data/spec/controllers/publish_my_data/resources_controller_spec.rb +0 -71
- data/spec/controllers/publish_my_data/vocabularies_controller_spec.rb +14 -0
- data/spec/dummy/config/environments/development.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/dummy/log/test.log +208075 -0
- data/spec/factories/concept_scheme_factories.rb +17 -13
- data/spec/factories/dataset_factories.rb +2 -0
- data/spec/factories/example_resource_factories.rb +9 -0
- data/spec/factories/ontology_factories.rb +17 -12
- data/spec/factories/property_factories.rb +1 -1
- data/spec/factories/resource_factories.rb +10 -0
- data/spec/features/running_a_sparql_query_spec.rb +2 -2
- data/spec/features/viewing_resources_spec.rb +96 -0
- data/spec/{renderers → lib}/publish_my_data/renderers_spec.rb +0 -0
- data/spec/models/publish_my_data/concept_scheme_spec.rb +20 -0
- data/spec/models/publish_my_data/dataset_spec.rb +113 -11
- data/spec/models/publish_my_data/example_resource_spec.rb +18 -0
- data/spec/models/publish_my_data/ontology_spec.rb +20 -0
- data/spec/models/publish_my_data/resource_spec.rb +63 -0
- data/spec/models/publish_my_data/third_party_concept_scheme_spec.rb +16 -0
- data/spec/models/publish_my_data/third_party_ontology_spec.rb +16 -0
- data/spec/spec_helper.rb +2 -1
- data/spec/support/all_features.rb +26 -0
- data/spec/support/data_download.rb +60 -0
- data/spec/support/vocabularies.rb +150 -0
- metadata +53 -33
- data/app/views/publish_my_data/ontologies/_classes.html.erb +0 -3
- data/app/views/publish_my_data/ontologies/_properties.html.erb +0 -3
- data/config/initializers/zz_factories.rb +0 -7
- data/lib/publish_my_data/concerns.rb +0 -4
- data/lib/publish_my_data/concerns/controllers/resource.rb +0 -23
- data/lib/publish_my_data/concerns/controllers/sparql.rb +0 -86
- data/lib/publish_my_data/concerns/models/resource.rb +0 -14
- data/lib/publish_my_data/render_params.rb +0 -7
- data/lib/publish_my_data/render_params/concept_render_params.rb +0 -18
- data/lib/publish_my_data/render_params/concept_scheme_render_params.rb +0 -31
- data/lib/publish_my_data/render_params/dataset_render_params.rb +0 -32
- data/lib/publish_my_data/render_params/ontology_class_render_params.rb +0 -18
- data/lib/publish_my_data/render_params/ontology_render_params.rb +0 -41
- data/lib/publish_my_data/render_params/property_render_params.rb +0 -18
- data/lib/publish_my_data/render_params/resource_render_params.rb +0 -17
@@ -1,6 +1,11 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
module DefinedByOntology
|
3
|
+
extend ActiveSupport::Concern
|
3
4
|
|
5
|
+
included do
|
6
|
+
field :defined_by, RDF::RDFS.isDefinedBy, :is_uri => true
|
7
|
+
end
|
8
|
+
|
4
9
|
def defined_by_ontology
|
5
10
|
ontology_uri = read_predicate(RDF::RDFS.isDefinedBy).first
|
6
11
|
Ontology.find(ontology_uri) rescue nil if ontology_uri
|
@@ -1,13 +1,17 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
class ConceptScheme
|
3
3
|
include Tripod::Resource
|
4
|
-
include
|
4
|
+
include AllFeatures
|
5
5
|
|
6
6
|
rdf_type RDF::SKOS.ConceptScheme
|
7
|
-
|
7
|
+
deprecated_rdf_type 'http://publishmydata.com/def/concept-scheme#DeprecatedConceptScheme'
|
8
|
+
|
9
|
+
def self.uri_from_slug(slug)
|
10
|
+
"http://#{PublishMyData.local_domain}/def/#{slug}"
|
11
|
+
end
|
8
12
|
|
9
13
|
def concepts
|
10
|
-
|
14
|
+
@concepts ||= Concept.find_by_sparql(
|
11
15
|
"SELECT DISTINCT ?uri ?graph
|
12
16
|
WHERE {
|
13
17
|
GRAPH ?graph {
|
@@ -17,5 +21,29 @@ module PublishMyData
|
|
17
21
|
}"
|
18
22
|
)
|
19
23
|
end
|
24
|
+
|
25
|
+
def local?
|
26
|
+
true
|
27
|
+
end
|
28
|
+
|
29
|
+
def eager_load!
|
30
|
+
super
|
31
|
+
self.concepts.each{|c| c.eager_load!}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Overrides
|
35
|
+
['to_rdf', 'to_ttl', 'to_nt', 'to_json'].each do |method_name|
|
36
|
+
define_method method_name do |opts={}|
|
37
|
+
resources = Resource.find_by_sparql("
|
38
|
+
SELECT DISTINCT ?uri
|
39
|
+
WHERE {
|
40
|
+
{ SELECT ?uri WHERE { GRAPH <#{self.graph_uri}> {?uri ?p ?o} } }
|
41
|
+
UNION
|
42
|
+
{ SELECT ?uri WHERE { GRAPH <#{self.data_graph_uri}> {?uri ?p ?o} } }
|
43
|
+
}
|
44
|
+
")
|
45
|
+
Tripod::ResourceCollection.new(resources).send(method_name)
|
46
|
+
end
|
47
|
+
end
|
20
48
|
end
|
21
49
|
end
|
@@ -1,135 +1,9 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
class Dataset
|
3
3
|
include Tripod::Resource
|
4
|
-
include
|
5
|
-
|
6
|
-
# basics
|
7
|
-
field :title, RDF::DC.title
|
8
|
-
field :comment, RDF::RDFS.comment #short desc
|
9
|
-
field :description, RDF::DC.description # long desc
|
10
|
-
|
11
|
-
# licence, owner, contact
|
12
|
-
field :publisher, RDF::DC.publisher, :is_uri => true # value is a URI of a publisher
|
13
|
-
field :license, RDF::DC.license, :is_uri => true # value is URI of where licence is defined.
|
14
|
-
field :contact_email, RDF::PMD_DS.contactEmail, :is_uri => true
|
15
|
-
# NOTE: for contact, use :publisher's foaf:mbox value (in this metadata graph).
|
16
|
-
|
17
|
-
# quality, updates, maintenance
|
18
|
-
field :issued, RDF::DC.issued, :datatype => RDF::XSD.dateTime # value is DateTime literal
|
19
|
-
field :modified, RDF::DC.modified, :datatype => RDF::XSD.dateTime # value is DateTime literal
|
20
|
-
# field :update_periodicity, RDF::DC.accrualPeriodicity # waiting for response on what the value should be.
|
21
|
-
|
22
|
-
# where to get it
|
23
|
-
field :data_dump, RDF::VOID.dataDump, :is_uri => true # full download URI
|
24
|
-
|
25
|
-
# what the data is about
|
26
|
-
field :theme, RDF::DCAT.theme, :is_uri => true
|
27
|
-
field :tags, RDF::DCAT.keyword, :multivalued => true # values are string literals
|
28
|
-
|
29
|
-
# field :spatial_coverage, RDF::DC.spatial # value is a URI for region covered, e.g. England.
|
30
|
-
# field :temporal_coverage, RDF::DC.temporal # value is a time interval URI
|
31
|
-
# field :spatial_granularity, RDF::DC.spatial # value is class of the objects of refArea
|
32
|
-
# field :temporal_granularity, RDF::DC.temporal # value is class of objects of refPeriod
|
33
|
-
|
34
|
-
field :size, RDF::VOID.triples # value is integer.
|
35
|
-
field :replaced_by, RDF::DC.isReplacedBy, is_uri: true
|
4
|
+
include DatasetPowers
|
36
5
|
|
37
6
|
rdf_type RDF::PMD_DS.Dataset
|
38
|
-
|
39
|
-
cattr_accessor :DEPRECATED_DATASET_TYPE
|
40
|
-
self.DEPRECATED_DATASET_TYPE = RDF::PMD_DS.DeprecatedDataset
|
41
|
-
|
42
|
-
def slug
|
43
|
-
Dataset.slug_from_uri(self.uri)
|
44
|
-
end
|
45
|
-
|
46
|
-
def data_graph_uri
|
47
|
-
Dataset.data_graph_uri(self.slug)
|
48
|
-
end
|
49
|
-
|
50
|
-
def metadata_graph_uri
|
51
|
-
Dataset.metadata_graph_uri(self.slug)
|
52
|
-
end
|
53
|
-
|
54
|
-
def to_param
|
55
|
-
slug
|
56
|
-
end
|
57
|
-
|
58
|
-
def resources_in_dataset_criteria
|
59
|
-
Resource.all.graph(self.data_graph_uri)
|
60
|
-
end
|
61
|
-
|
62
|
-
def theme_obj
|
63
|
-
Theme.find(self.theme.to_s) rescue nil
|
64
|
-
end
|
65
|
-
|
66
|
-
def deprecated?
|
67
|
-
self.rdf_type.include?(Dataset.DEPRECATED_DATASET_TYPE)
|
68
|
-
end
|
69
|
-
|
70
|
-
class << self
|
71
|
-
|
72
|
-
def uri_from_data_graph_uri(data_graph_uri)
|
73
|
-
data_graph_uri.to_s.gsub("/graph/", "/data/")
|
74
|
-
end
|
75
|
-
|
76
|
-
# this is the graph that dataset metadata goes in.
|
77
|
-
def metadata_graph_uri(slug)
|
78
|
-
"#{data_graph_uri(slug)}/metadata"
|
79
|
-
end
|
80
|
-
|
81
|
-
# this is the dataset that the actual data will go in
|
82
|
-
def data_graph_uri(slug)
|
83
|
-
"http://#{PublishMyData.local_domain}/graph/#{slug}"
|
84
|
-
end
|
85
|
-
|
86
|
-
def uri_from_data_graph_uri(data_graph_uri)
|
87
|
-
data_graph_uri.to_s.sub("/graph/", "/data/")
|
88
|
-
end
|
89
|
-
|
90
|
-
def find_by_slug(slug)
|
91
|
-
Dataset.find(uri_from_slug(slug))
|
92
|
-
end
|
93
|
-
|
94
|
-
def uri_from_slug(slug)
|
95
|
-
"http://#{PublishMyData.local_domain}/data/#{slug}"
|
96
|
-
end
|
97
|
-
|
98
|
-
def slug_from_uri(uri)
|
99
|
-
root_uri = uri_from_slug('')
|
100
|
-
uri.to_s.gsub(root_uri, '')
|
101
|
-
end
|
102
|
-
|
103
|
-
def ordered_datasets_criteria
|
104
|
-
Dataset.all.where("?uri <#{RDF::DC.title}> ?title").order("?title")
|
105
|
-
end
|
106
|
-
|
107
|
-
def deprecation_last_query_str
|
108
|
-
"
|
109
|
-
SELECT ?uri where {
|
110
|
-
# this bit is all the non-deprecated ones
|
111
|
-
{
|
112
|
-
SELECT * WHERE {
|
113
|
-
?uri a <http://publishmydata.com/def/dataset#Dataset> .
|
114
|
-
?uri <#{RDF::DC.title}> ?title . # select title so we can order
|
115
|
-
MINUS {
|
116
|
-
?uri a <http://publishmydata.com/def/dataset#DeprecatedDataset>
|
117
|
-
}
|
118
|
-
}
|
119
|
-
ORDER BY ?title
|
120
|
-
}
|
121
|
-
UNION
|
122
|
-
# this bit is all the deprecated ones
|
123
|
-
{
|
124
|
-
SELECT * WHERE {
|
125
|
-
?uri a <http://publishmydata.com/def/dataset#DeprecatedDataset> .
|
126
|
-
?uri <#{RDF::DC.title}> ?title . # select title so we can order
|
127
|
-
}
|
128
|
-
ORDER BY ?title
|
129
|
-
}
|
130
|
-
}
|
131
|
-
"
|
132
|
-
end
|
133
|
-
end
|
7
|
+
deprecated_rdf_type RDF::PMD_DS.DeprecatedDataset
|
134
8
|
end
|
135
9
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module PublishMyData
|
2
|
+
class ExampleResource
|
3
|
+
include Tripod::Resource
|
4
|
+
include BasicFeatures
|
5
|
+
|
6
|
+
field :rdf_type, RDF.type, :multivalued => true, :is_uri => true
|
7
|
+
|
8
|
+
def eager_load!
|
9
|
+
eager_load_predicate_triples!(labels_only: true)
|
10
|
+
eager_load_object_triples!(labels_only: true)
|
11
|
+
end
|
12
|
+
|
13
|
+
def as_ttl
|
14
|
+
graph = RDF::Graph.new
|
15
|
+
repository.query( [@uri, :predicate, :object] ) do |statement|
|
16
|
+
graph << statement
|
17
|
+
end
|
18
|
+
graph.dump(:ttl)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,13 +1,17 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
class Ontology
|
3
3
|
include Tripod::Resource
|
4
|
-
include
|
4
|
+
include AllFeatures
|
5
5
|
|
6
6
|
rdf_type RDF::OWL.Ontology
|
7
|
-
|
7
|
+
deprecated_rdf_type 'http://publishmydata.com/def/ontology#DeprecatedOntology'
|
8
8
|
|
9
|
-
def
|
10
|
-
|
9
|
+
def self.uri_from_slug(slug)
|
10
|
+
"http://#{PublishMyData.local_domain}/def/#{slug}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def classes
|
14
|
+
@classes ||= OntologyClass.find_by_sparql("
|
11
15
|
SELECT DISTINCT ?uri ?graph
|
12
16
|
WHERE {
|
13
17
|
GRAPH ?graph {
|
@@ -25,8 +29,8 @@ module PublishMyData
|
|
25
29
|
)
|
26
30
|
end
|
27
31
|
|
28
|
-
def
|
29
|
-
|
32
|
+
def properties
|
33
|
+
@properties ||= Property.find_by_sparql("
|
30
34
|
SELECT DISTINCT ?uri ?graph
|
31
35
|
WHERE {
|
32
36
|
GRAPH ?graph {
|
@@ -36,5 +40,30 @@ module PublishMyData
|
|
36
40
|
}"
|
37
41
|
)
|
38
42
|
end
|
43
|
+
|
44
|
+
def local?
|
45
|
+
true
|
46
|
+
end
|
47
|
+
|
48
|
+
def eager_load!
|
49
|
+
super
|
50
|
+
classes.each{|c| c.eager_load!}
|
51
|
+
properties.each{|p| p.eager_load!}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Overrides
|
55
|
+
['to_rdf', 'to_ttl', 'to_nt', 'to_json'].each do |method_name|
|
56
|
+
define_method method_name do |opts={}|
|
57
|
+
resources = Resource.find_by_sparql("
|
58
|
+
SELECT DISTINCT ?uri
|
59
|
+
WHERE {
|
60
|
+
{ SELECT ?uri WHERE { GRAPH <#{self.graph_uri}> {?uri ?p ?o} } }
|
61
|
+
UNION
|
62
|
+
{ SELECT ?uri WHERE { GRAPH <#{self.data_graph_uri}> {?uri ?p ?o} } }
|
63
|
+
}
|
64
|
+
")
|
65
|
+
Tripod::ResourceCollection.new(resources).send(method_name)
|
66
|
+
end
|
67
|
+
end
|
39
68
|
end
|
40
69
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
class OntologyClass
|
3
3
|
include Tripod::Resource
|
4
|
-
include
|
5
|
-
include
|
6
|
-
|
7
|
-
field :label, RDF::RDFS.label
|
8
|
-
field :defined_by, RDF::RDFS.isDefinedBy, :is_uri => true
|
4
|
+
include BasicFeatures
|
5
|
+
include DefinedByOntology
|
9
6
|
|
7
|
+
rdf_type RDF::OWL.Class
|
10
8
|
end
|
11
9
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module PublishMyData
|
2
2
|
class Property
|
3
3
|
include Tripod::Resource
|
4
|
-
include
|
5
|
-
include
|
6
|
-
|
7
|
-
field :label, RDF::RDFS.label
|
8
|
-
field :defined_by, RDF::RDFS.isDefinedBy, :is_uri => true
|
4
|
+
include BasicFeatures
|
5
|
+
include DefinedByOntology
|
9
6
|
|
7
|
+
rdf_type RDF.Property
|
10
8
|
end
|
11
9
|
end
|
@@ -2,13 +2,34 @@ module PublishMyData
|
|
2
2
|
class Resource
|
3
3
|
|
4
4
|
include Tripod::Resource
|
5
|
-
include
|
5
|
+
include BasicFeatures
|
6
6
|
|
7
|
-
field :label, RDF::RDFS.label
|
8
7
|
field :rdf_type, RDF.type, :multivalued => true, :is_uri => true
|
9
8
|
|
10
|
-
|
11
|
-
|
9
|
+
cattr_accessor :LOCAL_RESOURCES, :RESOURCES
|
10
|
+
@@LOCAL_RESOURCES = [Dataset, ConceptScheme, Ontology]
|
11
|
+
@@RESOURCES = [ThirdParty::Ontology, ThirdParty::ConceptScheme, Concept, OntologyClass, Property, RdfType]
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def uri_from_host_and_doc_path(host, doc_path, format="")
|
15
|
+
'http://' + host + '/id/' + doc_path.split('?')[0].sub(/\.#{format}$/,'')
|
16
|
+
end
|
17
|
+
|
18
|
+
alias_method :find_by_uri, :find
|
19
|
+
def find(uri, opts={})
|
20
|
+
resource = self.find_by_uri(uri)
|
21
|
+
type = resource.read_predicate(RDF.type)
|
22
|
+
|
23
|
+
if opts[:local]
|
24
|
+
self.LOCAL_RESOURCES.each do |klass|
|
25
|
+
return klass.find(uri) if type.include?(klass.get_rdf_type)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
self.RESOURCES.each do |klass|
|
29
|
+
return klass.find(uri) if type.include?(klass.get_rdf_type)
|
30
|
+
end
|
31
|
+
return resource
|
32
|
+
end
|
12
33
|
end
|
13
34
|
|
14
35
|
def theme
|
@@ -18,97 +39,5 @@ module PublishMyData
|
|
18
39
|
def dataset
|
19
40
|
Dataset.find(Dataset.uri_from_data_graph_uri(self.graph_uri)) rescue nil
|
20
41
|
end
|
21
|
-
|
22
|
-
# this calls render_params on the right type of RenderParams object.
|
23
|
-
# (strategy pattern-ish).
|
24
|
-
def render_params(request)
|
25
|
-
render_params_class.new(self).
|
26
|
-
render_params(
|
27
|
-
pagination_params: ResourcePaginationParams.from_request(request)
|
28
|
-
)
|
29
|
-
end
|
30
|
-
|
31
|
-
# Don't worry that these as_xxx methods look like they'll do an extra lookup.
|
32
|
-
# In production, it'll be cached from a moment ago anyway!
|
33
|
-
|
34
|
-
# this copies all teh data from this resource's repository into that of a new instance of the class passed in.
|
35
|
-
def as_resource_of_class(klass)
|
36
|
-
r = klass.new(self.uri)
|
37
|
-
r.hydrate!(graph: self.repository_as_graph)
|
38
|
-
r
|
39
|
-
end
|
40
|
-
|
41
|
-
def as_dataset
|
42
|
-
as_resource_of_class(Dataset)
|
43
|
-
end
|
44
|
-
|
45
|
-
def as_ontology
|
46
|
-
as_resource_of_class(Ontology)
|
47
|
-
end
|
48
|
-
|
49
|
-
def as_concept_scheme
|
50
|
-
as_resource_of_class(ConceptScheme)
|
51
|
-
end
|
52
|
-
|
53
|
-
def as_concept
|
54
|
-
as_resource_of_class(Concept)
|
55
|
-
end
|
56
|
-
|
57
|
-
def as_property
|
58
|
-
as_resource_of_class(Property)
|
59
|
-
end
|
60
|
-
|
61
|
-
def as_ontology_class
|
62
|
-
as_resource_of_class(OntologyClass)
|
63
|
-
end
|
64
|
-
|
65
|
-
def is_dataset?
|
66
|
-
read_type_predicate.include?(RDF::PMD_DS.Dataset)
|
67
|
-
end
|
68
|
-
|
69
|
-
def is_ontology?
|
70
|
-
read_type_predicate.include?(RDF::OWL.Ontology)
|
71
|
-
end
|
72
|
-
|
73
|
-
def is_class?
|
74
|
-
read_type_predicate.include?(RDF::OWL.Class) || read_type_predicate.include?(RDF::RDFS.Class)
|
75
|
-
end
|
76
|
-
|
77
|
-
def is_property?
|
78
|
-
read_type_predicate.include?(RDF.Property)
|
79
|
-
end
|
80
|
-
|
81
|
-
def is_concept_scheme?
|
82
|
-
read_type_predicate.include?(RDF::SKOS.ConceptScheme)
|
83
|
-
end
|
84
|
-
|
85
|
-
def is_concept?
|
86
|
-
read_type_predicate.include?(RDF::SKOS.Concept)
|
87
|
-
end
|
88
|
-
|
89
|
-
private
|
90
|
-
|
91
|
-
def read_type_predicate
|
92
|
-
read_predicate(RDF.type)
|
93
|
-
end
|
94
|
-
|
95
|
-
def render_params_class
|
96
|
-
if self.is_dataset?
|
97
|
-
DatasetRenderParams
|
98
|
-
elsif self.is_ontology?
|
99
|
-
OntologyRenderParams
|
100
|
-
elsif self.is_class?
|
101
|
-
OntologyClassRenderParams
|
102
|
-
elsif self.is_property?
|
103
|
-
PropertyRenderParams
|
104
|
-
elsif self.is_concept_scheme?
|
105
|
-
ConceptSchemeRenderParams
|
106
|
-
elsif self.is_concept?
|
107
|
-
ConceptRenderParams
|
108
|
-
else
|
109
|
-
ResourceRenderParams
|
110
|
-
end
|
111
|
-
end
|
112
42
|
end
|
113
|
-
|
114
43
|
end
|