【问题标题】:Getting a list of available hierarchies from statistics.gov.scot从 statistics.gov.scot 获取可用层次结构的列表
【发布时间】:2017-12-28 21:39:16
【问题描述】:

我有兴趣从statistics.gov.scot 获取可用的不同层次结构的列表。我想列出的最合适的层次结构如下:

http://statistics.gov.scot/def/hierarchy/best-fit#community-health-partnership
http://statistics.gov.scot/def/hierarchy/best-fit#council-area
http://statistics.gov.scot/def/hierarchy/best-fit#country

可通过this sample geography 的API 部分获得。

期望的结果

我希望返回所需的结果:

community-health-partnership
council-area
country

我如何构建实际会产生该查询的查询,我可以通过以下方式获取所有可用地区的列表:

PREFIX sdmx: <http://purl.org/linked-data/sdmx/2009/dimension#>
SELECT DISTINCT ?framework 
WHERE {
    ?a sdmx:refArea ?framework .
} LIMIT 10

我正在尝试一些东西:

PREFIX fits: <http://statistics.gov.scot/def/hierarchy/best-fit#>
SELECT DISTINCT ?framework 
WHERE {
    ?a fits ?framework .
} LIMIT 10

但这种语法自然是不正确的。

【问题讨论】:

    标签: sparql opendata


    【解决方案1】:

    从their SPARQL endpoint 开始,你可以这样做——

    DESCRIBE <http://statistics.gov.scot/def/hierarchy/best-fit#country>
    

    然后,根据这些结果,您可能会尝试这样的事情,结果可能不是您说的想要的,但可能会更好 --

    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    
    SELECT  ?hierarchy
            ?label
    WHERE
      { ?hierarchy  rdfs:subPropertyOf  <http://statistics.gov.scot/def/hierarchy/best-fit>
                 ;  rdfs:label          ?label
      }
    

    【讨论】:

    • 如果对象 B 通过某个对象属性链接到对象 A,我如何获取对象 B 的数据属性。就像在我的情况下,汽车和注册是两个类,汽车具有 hasRegistration 对象属性。注册具有数据属性registration_number。所以我想获取registration_number值以及汽车的数据属性?谢谢
    • @MohsinSaeed - 这就是我们所说的“一个新问题”。请pose it as such, in conformance with site guidelines.
    猜你喜欢
    • 2011-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-29
    • 1970-01-01
    相关资源
    最近更新 更多