Dear All,
I need to extract onProperty, someValuesFrom, intersectionOf for each class in 
owl file. I created SPARQL query , but it does not extract all onProperty, 
someValuesFrom, intersectionOf for each class that included in my file here is 
the SPARQL query :
    PREFIX abc: <http://owl.cs.manchester.ac.uk/2009/07/sssw/people#>    PREFIX 
ghi: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>    PREFIX mno: 
<http://www.w3.org/2001/XMLSchema#>    PREFIX owl: 
<http://www.w3.org/2002/07/owl#>    PREFIX rdfs: 
<http://www.w3.org/2000/01/rdf-schema#>    PREFIX rdf: 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
        SELECT (COUNT(*) AS ?no) ?class ?subClassOf ?ObjectProperty 
?someValuesFrom ?intersectionOf WHERE{ ?class a owl:Class . FILTER( 
STRSTARTS(STR(?class),"http://www.w3.org/2002/07/owl#";) || 
STRSTARTS(STR(?class),"http://owl.cs.manchester.ac.uk/2009/07/sssw/people#";))   
     OPTIONAL{ ?class rdfs:subClassOf ?subClassOf .}         OPTIONAL{ ?class 
rdfs:subClassOf ?r .   ?r a owl:Restriction .  ?r owl:onProperty 
?ObjectProperty .     ?r owl:someValuesFrom ?someValuesFrom .}        
OPTIONAL{?class owl:equivalentClass ?f .        ?f a owl:Restriction .  ?f 
owl:onProperty ?ObjectProperty .}    OPTIONAL{?class owl:equivalentClass ?f .   
     ?f a owl:Restriction .  ?f owl:someValuesFrom owl:Class .       #?f a 
owl:Class .       ?f owl:unionOf  ?t.     ?t a owl:Restriction .  ?t 
owl:onProperty ?ObjectProperty .     ?t owl:someValuesFrom ?someValuesFrom . ?t 
a owl:Class .        }       OPTIONAL{?class owl:equivalentClass ?f .        ?f 
a owl:Restriction .  ?f a owl:Class .        ?f owl:intersectionOf+ 
?intersectionOf .        ?intersectionOf a owl:Class .   }       } GROUP BY 
?class ?subClassOf ?ObjectProperty ?someValuesFrom ?intersectionOf ORDER BY ?no

This is my OWL file:

    <?xml version="1.0"?>    <rdf:RDF        
xmlns="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#";        
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";        
xmlns:xsd="http://www.w3.org/2001/XMLSchema#";        
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";        
xmlns:owl="http://www.w3.org/2002/07/owl#";        
xmlns:ns0="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#";      
xml:base="http://owl.cs.manchester.ac.uk/2009/07/sssw/people";>      
<owl:Ontology rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people"/>  
    <owl:Class rdf:about="http://www.w3.org/2002/07/owl#Thing"/>      
<owl:Class 
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#haulage_worker";>  
      <rdfs:comment rdf:datatype="http://www.w3.org/2001/XMLSchema#string";      
 ></rdfs:comment>        <owl:equivalentClass>          <owl:Restriction>       
     <owl:onProperty>              <owl:ObjectProperty      
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#works_for"/>      
      </owl:onProperty>            <owl:someValuesFrom>            <owl:Class>  
              <owl:unionOf rdf:parseType="Collection">                  
<owl:Restriction>                   <owl:onProperty>                    
<owl:ObjectProperty    
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#part_of"/>        
           </owl:onProperty>                   <owl:someValuesFrom>             
       <owl:Class   
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#haulage_company"/>
                   </owl:someValuesFrom>                  </owl:Restriction>    
              <owl:Class   
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#haulage_company"/>
                </owl:unionOf>              </owl:Class>             
</owl:someValuesFrom>            </owl:Restriction>         
</owl:equivalentClass>        <rdfs:label 
rdf:datatype="http://www.w3.org/2001/XMLSchema#string";        >haulage 
worker</rdfs:label>      </owl:Class>      <owl:Class 
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#man";>        
<owl:equivalentClass>          <owl:Class>            <owl:intersectionOf 
rdf:parseType="Collection">              <owl:Class 
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#adult"/>          
    <owl:Class 
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#person"/>         
     <owl:Class 
rdf:about="http://owl.cs.manchester.ac.uk/2009/07/sssw/people#male"/>           
 </owl:intersectionOf>          </owl:Class>            </owl:equivalentClass>  
    </owl:Class>    </rdf:RDF>
I got this output :

--------------------------------------------------------------------------------------------|
 no | class               | subClassOf | ObjectProperty | someValuesFrom | 
intersectionOf 
|============================================================================================|
 1  | abc:adult           |            |                |                |      
          || 1  | abc:haulage_company |            |                |           
     |                || 1  | abc:male            |            |                
|                |                || 1  | abc:man             |            |    
            |                |                || 1  | abc:person          |     
       |                |                |                || 1  | owl:Thing     
      |            |                |                |                || 1  | 
abc:haulage_worker  |            | abc:works_for  |                |            
    
|-------------------------------------------------------------------------------------------
I'm still trying to find a solution for my problem, but I did not find yet :( . 
If you have any suggestion please help me with it.  
Many thanks for your help in advance :)
                                          With Regrads                          
          
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to