title: Finding properties that are common to a class in DBpedia
body: <p>I have a question on how to find distinct properties for instances that share a class in DBpedia. I think it is more on the lines of how to do it in SPARQL. I tried out this query here :</p>
  
  <pre><code>SELECT DISTINCT ?p WHERE {
         ?s a &lt;http://dbpedia.org/ontology/Film&gt; .
         ?s ?p ?o.
  } 
  </code></pre>
  
  <p>However, I realized that this query gives you all the distinct properties that are used by all instances, essentially while the distinct properties for the instance of a class might remain just the same i.e. in <a href="http://swat.cse.lehigh.edu/projects/lubm/" rel="nofollow noreferrer">LUBM</a> for example, in a real life Wikipedia based extraction set like DBpedia, you don't have that. So a count on the query above would give me <code>1767 distinct properties</code>. But how do you find all the properties that are common to the instance of a class in SPARQL? As in, a set of properties that occur for the instance of a class and are common for an entire set. This should be a smaller set than the 1767 right? Again for LUBM the above query does it and seems like all the instances share the same set of distinct properties. I guess for DBpedia that wouldn't be the case. I also know that this can be done in Java for example. I could just iterate through all the properties for all the instances of the class and just save the ones that appear in all. I think that is too expensive,and was wondering if it is possible in SPARQL. </p>
  
  <p>PS: Somebody sort of asked a related question <a href="https://stackoverflow.com/questions/35446323/retrieving-common-classes-attributes-from-dbpedia-with-sparql/35447231">here</a>, but as I have written here, I am not sure if that actually captures the common properties to all classes. </p>