Class: SemanticCrawler::LinkedGeoData::RelevantNode
- Inherits:
-
Object
- Object
- SemanticCrawler::LinkedGeoData::RelevantNode
- Defined in:
- lib/semantic_crawler/linked_geo_data/relevant_node.rb
Overview
Specifies relevant node that is classified by a type and GPS coordinates.
Constant Summary collapse
- @@NAMESPACES =
Namespace hash
{ "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs" => "http://www.w3.org/2000/01/rdf-schema#", "lgd" => "http://linkedgeodata.org/triplify/", "lgdp" => "http://linkedgeodata.org/property/", "lgdo" => "http://linkedgeodata.org/ontology/", "geo" => "http://www.w3.org/2003/01/geo/wgs84_pos#" }
Instance Method Summary collapse
-
#contributor ⇒ String
User link.
-
#created_by ⇒ String
Data Source.
-
#has_city ⇒ String
City name.
-
#has_country ⇒ String
Country in ISO 3166-1 alpha-2.
-
#has_house_number ⇒ String
House number.
-
#has_postal_code ⇒ String
Postal code.
-
#has_street ⇒ String
Street name.
-
#initialize(new_root_node) ⇒ RelevantNode
constructor
Constructor that takes the root node received from SemanticCrawler::LinkedGeoData::RelevantNodes.
-
#latitude ⇒ String
geo:lat.
-
#longitude ⇒ String
geo:long.
-
#member_of_way ⇒ Object
Link to way.
-
#note ⇒ String
Comment about the entity.
-
#query_root_node(xpath_query, namespaces = {}) ⇒ Object
Query the root_node.
-
#type ⇒ String
The type as URL.
-
#wheelchair ⇒ String
Is this place wheelchair friendly?.
-
#xml_document ⇒ String
Outputs the document as XML.
Constructor Details
#initialize(new_root_node) ⇒ RelevantNode
Constructor that takes the root node received from SemanticCrawler::LinkedGeoData::RelevantNodes
21 22 23 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 21 def initialize(new_root_node) @root_node = new_root_node end |
Instance Method Details
#contributor ⇒ String
User link
57 58 59 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 57 def contributor query_root_node("lgdo:contributor/@rdf:resource", @@NAMESPACES).to_s end |
#created_by ⇒ String
Data Source
51 52 53 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 51 def created_by query_root_node("lgdp:created_by/text()", @@NAMESPACES).to_s end |
#has_city ⇒ String
City name
92 93 94 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 92 def has_city query_root_node("lgdo:hasCity/text()", @@NAMESPACES).to_s end |
#has_country ⇒ String
Country in ISO 3166-1 alpha-2
86 87 88 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 86 def has_country query_root_node("lgdo:hasCountry/text()", @@NAMESPACES).to_s end |
#has_house_number ⇒ String
House number
80 81 82 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 80 def has_house_number query_root_node("lgdo:hasHouseNumber/text()", @@NAMESPACES).to_s end |
#has_postal_code ⇒ String
Postal code
74 75 76 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 74 def has_postal_code query_root_node("lgdo:hasPostalCode/text()", @@NAMESPACES).to_s end |
#has_street ⇒ String
Street name
68 69 70 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 68 def has_street query_root_node("lgdo:hasStreet/text()", @@NAMESPACES).to_s end |
#latitude ⇒ String
geo:lat
27 28 29 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 27 def latitude query_root_node("geo:lat/text()", @@NAMESPACES).to_s end |
#longitude ⇒ String
geo:long
33 34 35 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 33 def longitude query_root_node("geo:long/text()", @@NAMESPACES).to_s end |
#member_of_way ⇒ Object
Link to way
62 63 64 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 62 def member_of_way query_root_node("lgdo:memberOfWay/@rdf:resource", @@NAMESPACES) end |
#note ⇒ String
Comment about the entity
45 46 47 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 45 def note query_root_node("lgdp:note/text()", @@NAMESPACES).to_s end |
#query_root_node(xpath_query, namespaces = {}) ⇒ Object
Query the root_node
103 104 105 106 107 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 103 def query_root_node(xpath_query, namespaces = {}) if !@root_node.nil? @root_node.xpath(xpath_query, namespaces) end end |
#type ⇒ String
The type as URL
39 40 41 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 39 def type query_root_node("rdf:type/@rdf:resource", @@NAMESPACES).to_s end |
#wheelchair ⇒ String
Is this place wheelchair friendly?
98 99 100 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 98 def wheelchair query_root_node("lgdo:wheelchair/@rdf:resource", @@NAMESPACES).to_s end |
#xml_document ⇒ String
Outputs the document as XML
111 112 113 |
# File 'lib/semantic_crawler/linked_geo_data/relevant_node.rb', line 111 def xml_document @root_node.to_s end |