Get all properties for a DBpedia class

前端 未结 2 822
孤城傲影
孤城傲影 2020-12-14 18:07

How to get a list of properties for a specific class? Consider the class dbpedia-owl:Person. All instances of the Person class have some properties prefixed wit

2条回答
  •  Happy的楠姐
    2020-12-14 18:31

    The one that works is:

    select distinct ?property where { 
       ?property  
                                  . }
    

    In this query you are asking for all the properties that have dbpedia:Person as rdfs:domain. This query requires a schema definition to work and sometime datasets don't really follow perfectly the schemas. For those datasets you would try this other query

    select distinct ?property where {
             ?instance a  . 
             ?instance ?property ?obj . }
    

    This query looks at every instance of person binding every property that comes out of it. It is much harder than the first one, and in the dbpedia public instance you will get a time out. So you are better off with the first one if you want to use the public endpoint.

提交回复
热议问题