Sha256: 89975ffdcaa02975f63852070f50429ccb9e57070b032ceced155af04fd108bc

Contents?: true

Size: 1.06 KB

Versions: 19

Compression:

Stored size: 1.06 KB

Contents

module PublishMyData
  class Ontology
    include Tripod::Resource
    include PublishMyData::Concerns::Models::Resource

    rdf_type RDF::OWL.Ontology
    field :label, RDF::RDFS.label

    def ontology_classes
      Resource.find_by_sparql("
        SELECT DISTINCT ?uri ?graph
        WHERE {
          GRAPH ?graph {
            {
              ?uri <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <#{self.uri}> .
              ?uri a <http://www.w3.org/2002/07/owl#Class> .
            }
            UNION
            {
              ?uri <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <#{self.uri}> .
              ?uri a <http://www.w3.org/2000/01/rdf-schema#Class>
            }
          }
        }"
      )
    end

    def ontology_properties
      Resource.find_by_sparql("
        SELECT DISTINCT ?uri ?graph
         WHERE {
          GRAPH ?graph {
            ?uri <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <#{self.uri}> .
            ?uri a <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> .
          }
        }"
      )
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
publish_my_data-0.0.29 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.28 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.27 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.26 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.25 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.24 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.23 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.22 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.21 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.20 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.19 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.18 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.17 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.16 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.15 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.14 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.13 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.12 app/models/publish_my_data/ontology.rb
publish_my_data-0.0.11 app/models/publish_my_data/ontology.rb