以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  [求助]OWL:sameAs如何实现?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=61324)


--  作者:icecoolfire
--  发布时间:4/14/2008 10:38:00 AM

--  [求助]OWL:sameAs如何实现?
前一段时间在研究到OWL:sameAS这块,就尝试着进行多词同义的应用,我将“Jack”和“Jones”之间的关系设为owl:sameAs,然后对“Jack”的相关信息进行了编辑,接着利用Jena进行查询,结果如果查询“Jack”,那么可以得到预期的内容,如果查询“Jones”,则得到空白,那位大哥可以帮忙解释一下这是为什么?
--  作者:jpz6311whu
--  发布时间:4/14/2008 11:11:00 AM

--  
请楼主把你的程序源代码贴出来看看,你是如何通过jena查询的?
--  作者:icecoolfire
--  发布时间:4/14/2008 2:19:00 PM

--  
这个实验程序主体还是借鉴jiexincao大哥以前的那个程序:
查询过程如下:
public  ResIterator search(String item,String value){

    Property LookForProperty;
    ResIterator LookForResult=null;
    getInfModel myGet = new getInfModel ();

    LookForProperty=model.getProperty(myGet.itemToProperty(item));
    if(item.equals("author") )
    {
     Resource LookForValue;
     LookForValue=model.createResource(myGet.addNameSpace(value));
     LookForResult=model.listSubjectsWithProperty(LookForProperty,LookForValue);
    }
    else if (item.equals("title"))
    {
     String LookForValue = value;
     LookForResult=model.listSubjectsWithProperty(LookForProperty,LookForValue);
    }
    else if (item.equals("keywords"))
    {
//     Resource LookForValue;
//     LookForValue=model.createResource(myGet.addNameSpace(value));
     String LookForValue = value;
     LookForResult=model.listSubjectsWithProperty(LookForProperty,LookForValue);
    }
    else if (item.equals("ISBN"))
    {
     String LookForValue = value;
     LookForResult = model.listSubjectsWithProperty(LookForProperty,LookForValue);
    }

     return LookForResult;
}
public String getValue(Resource res,String item){
       String result=null;
       Property LookForProperty;
       LookForProperty=model.getProperty(myGet.itemToProperty(item));
       StmtIterator LookForResult=model.listStatements(res,LookForProperty,(RDFNode)null);

       while(LookForResult.hasNext() ){
       result=LookForResult.nextStatement().getObject().toString() ;
       }
       return myGet.removeType(result);//LookForResult.toString();
      }

public  NodeIterator getIterator(String res,String item){
     NodeIterator result=null;
     Resource resource=model.createResource(myGet.addPrefix(res));
     Property property=model.getProperty(myGet.itemToProperty(item));
     result=model.listObjectsOfProperty(resource,property);
     return result;
     }

另外构建的本体如下:
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:paper="http://www.icecoolfire.com#"
    xmlns="http://www.owl-ontologies.com/unnamed.owl#"
  xml:base="http://www.owl-ontologies.com/unnamed.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Publication"/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Person"/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Article"/>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Published">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Publication"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Citing">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf>
      <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#isCited"/>
    </owl:inverseOf>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Author">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Person"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#indCiting">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#bothCited">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#bothCited"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#isCited">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#Citing"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#Title">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#ISBN">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#content">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#keywords">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:SymmetricProperty rdf:about="http://www.icecoolfire.com#bothCiting">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#bothCiting"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:SymmetricProperty>
  <paper:Publication rdf:ID="High_education"/>
  <paper:Person rdf:ID="Gary"/>
  <paper:Article rdf:ID="Ontology">
    <paper:isCited>
      <paper:Article rdf:ID="Regular_Expression">
        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >regular</paper:keywords>
        <paper:Author>
          <paper:Person rdf:ID="Peter"/>
        </paper:Author>
        <paper:Published>
          <paper:Publication rdf:ID="People_mail"/>
        </paper:Published>
        <paper:Citing rdf:resource="#Ontology"/>
        <paper:isCited>
          <paper:Article rdf:ID="Core_Java">
            <paper:Author rdf:resource="#Gary"/>
            <paper:Citing>
              <paper:Article rdf:ID="JSP_design">
                <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >JSP</paper:keywords>
                <paper:Author>
                  <paper:Person rdf:ID="Jack">
                    <owl:sameAs>
                      <paper:Person rdf:ID="Jim">
                        <owl:sameAs rdf:resource="#Jack"/>
                      </paper:Person>
                    </owl:sameAs>
                  </paper:Person>
                </paper:Author>
                <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >JSP design</paper:Title>
                <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >ISBN978-7-115-16000-2</paper:ISBN>
                <paper:isCited rdf:resource="#Core_Java"/>
                <paper:Published rdf:resource="#High_education"/>
                <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >something about how to design the web with the help of JSP language</paper:content>
                <paper:isCited>
                  <paper:Article rdf:ID="Computer_Orgnazation">
                    <paper:isCited rdf:resource="#Ontology"/>
                    <paper:Citing>
                      <paper:Article rdf:ID="Programming_Csharp">
                        <paper:Citing>
                          <paper:Article rdf:ID="ASP.NET">
                            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >asp</paper:keywords>
                            <paper:Author>
                              <paper:Person rdf:ID="Williams">
                                <owl:sameAs>
                                  <paper:Person rdf:ID="Kim">
                                    <owl:sameAs rdf:resource="#Williams"/>
                                  </paper:Person>
                                </owl:sameAs>
                              </paper:Person>
                            </paper:Author>
                            <paper:Citing>
                              <paper:Article rdf:ID="Modern_Information_Retrival">
                                <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >ISBN978-7-115-16000-6</paper:ISBN>
                                <paper:Citing>
                                  <paper:Article rdf:ID="semantic_web">
                                    <paper:content rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >introduce the progess of  semantic web</paper:content>
                                    <paper:Citing>
                                      <paper:Article rdf:ID="Wordnet">
                                        <paper:isCited rdf:resource="#semantic_web"/>
                                        <paper:isCited>
                                          <paper:Article rdf:ID="OWL">
                                            <paper:isCited rdf:resource="#Regular_Expression"/>
                                            <paper:Citing>
                                              <paper:Article rdf:ID="RDF">
                                                <paper:Citing rdf:resource="#Ontology"/>
                                                <paper:content
                                                 rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >introduce the concept of Resource Description Framework</paper:content>
                                                <paper:isCited rdf:resource="#OWL"/>
                                                <paper:isCited rdf:resource="#semantic_web"/>
                                                <paper:Author rdf:resource="#Peter"/>
                                                <paper:Published>
                                                  <paper:Publication rdf:ID="Nature"/>
                                                </paper:Published>
                                                <paper:keywords
                                                 rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >RDF</paper:keywords>
                                                <paper:isCited rdf:resource="#Ontology"/>
                                                <paper:ISBN rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >ISBN978-7-115-16000-10</paper:ISBN>
                                                <paper:Citing rdf:resource="#OWL"/>
                                                <paper:Title rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >RDF</paper:Title>
                                              </paper:Article>
                                            </paper:Citing>
                                            <paper:Citing rdf:resource="#Ontology"/>
                                            <paper:Citing rdf:resource="#Wordnet"/>
                                            <paper:isCited rdf:resource="#semantic_web"/>
                                            <paper:Title rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >OWL</paper:Title>
                                            <paper:Author>
                                              <paper:Person rdf:ID="Tom"/>
                                            </paper:Author>
                                            <paper:content rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >introduce the content of the Ontology Web Language</paper:content>
                                            <paper:ISBN rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >ISBN978-7-115-16000-8</paper:ISBN>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >OWL</paper:keywords>
                                            <paper:isCited rdf:resource="#RDF"/>
                                            <paper:Published>
                                              <paper:Publication rdf:ID="Oreilly"/>
                                            </paper:Published>
                                          </paper:Article>
                                        </paper:isCited>
                                        <paper:Title rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >wordnet</paper:Title>
                                        <paper:Author rdf:resource="#Kim"/>
                                        <paper:isCited rdf:resource="#Programming_Csharp"/>
                                        <paper:isCited>
                                          <paper:Article rdf:ID="Search_Engine">
                                            <paper:Citing rdf:resource="#Wordnet"/>
                                            <paper:isCited rdf:resource="#Programming_Csharp"/>
                                            <paper:Title rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >Search_Engine</paper:Title>
                                            <paper:Citing rdf:resource="#Modern_Information_Retrival"/>
                                            <paper:content rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >tell you how to construct a search engine by yourself</paper:content>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >search</paper:keywords>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >engine</paper:keywords>
                                            <paper:Author rdf:resource="#Peter"/>
                                            <paper:Citing rdf:resource="#Core_Java"/>
                                            <paper:ISBN rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >ISBN978-7-115-16000-5</paper:ISBN>
                                            <paper:Published>
                                              <paper:Publication rdf:ID="Info.Sci."/>
                                            </paper:Published>
                                            <paper:isCited rdf:resource="#JSP_design"/>
                                          </paper:Article>
                                        </paper:isCited>
                                        <paper:Published rdf:resource="#Nature"/>
                                        <paper:Citing rdf:resource="#JSP_design"/>
                                        <paper:content rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >prepared for wordnet</paper:content>
                                        <paper:keywords rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >semantic</paper:keywords>
                                        <paper:ISBN rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >ISBN978-7-115-16000-13</paper:ISBN>
                                      </paper:Article>
                                    </paper:Citing>
                                    <paper:isCited rdf:resource="#Programming_Csharp"/>
                                    <paper:Author rdf:resource="#Jack"/>
                                    <paper:keywords rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >semantic</paper:keywords>
                                    <paper:Citing rdf:resource="#RDF"/>
                                    <paper:keywords rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >web</paper:keywords>
                                    <paper:Citing rdf:resource="#OWL"/>
                                    <paper:isCited rdf:resource="#Modern_Information_Retrival"/>
                                    <paper:Title rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >semantic web</paper:Title>
                                    <paper:Published rdf:resource="#People_mail"/>
                                    <paper:ISBN rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >ISBN978-7-115-16000-7</paper:ISBN>
                                  </paper:Article>
                                </paper:Citing>
                                <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >The book comprises two portions which complement and balance each other.The core portion includes nine chapters authored or coauthored by the designers of the book.The second portion which is fully intergrated with first,is formed by six state-of-the-art charpters written by leading reasearches in their fields.</paper:content>
                                <paper:isCited rdf:resource="#ASP.NET"/>
                                <paper:keywords rdf:datatype=
                                "http://www.w3.org/2001/XMLSchema#string"
                                >information</paper:keywords>
                                <paper:keywords rdf:datatype=
                                "http://www.w3.org/2001/XMLSchema#string"
                                >modern</paper:keywords>
                                <paper:isCited rdf:resource="#Search_Engine"/>
                                <paper:isCited rdf:resource="#Core_Java"/>
                                <paper:Published rdf:resource="#People_mail"/>
                                <paper:Author rdf:resource="#Peter"/>
                                <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >Modern_Information_Retrival</paper:Title>
                              </paper:Article>
                            </paper:Citing>
                            <paper:isCited rdf:resource="#Programming_Csharp"/>
                            <paper:Author rdf:resource="#Kim"/>
                            <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >ASP.NET</paper:Title>
                            <paper:Published rdf:resource="#Nature"/>
                            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >net</paper:keywords>
                            <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >something about how to use the language of ASP.NET</paper:content>
                            <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >ISBN978-7-115-16000-4</paper:ISBN>
                          </paper:Article>
                        </paper:Citing>
                        <paper:Citing rdf:resource="#Wordnet"/>
                        <paper:isCited rdf:resource="#Core_Java"/>
                        <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >something about how to utilise the language of Csharp</paper:content>
                        <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >Programming Csharp</paper:Title>
                        <paper:Author>
                          <paper:Person rdf:ID="James"/>
                        </paper:Author>
                        <paper:Citing rdf:resource="#Search_Engine"/>
                        <paper:isCited rdf:resource="#Regular_Expression"/>
                        <paper:Published rdf:resource="#Oreilly"/>
                        <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >ISBN978-7-115-16000-3</paper:ISBN>
                        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >Csharp</paper:keywords>
                        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >programming</paper:keywords>
                        <paper:isCited rdf:resource="#Computer_Orgnazation"/>
                        <paper:Citing rdf:resource="#semantic_web"/>
                      </paper:Article>
                    </paper:Citing>
                    <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >ISBN978-7-115-16000-11</paper:ISBN>
                    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >computer</paper:keywords>
                    <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >something about the compouter</paper:content>
                    <paper:Author rdf:resource="#Jack"/>
                    <paper:Published rdf:resource="#People_mail"/>
                    <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >computer orgnazation</paper:Title>
                    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >orgnazation</paper:keywords>
                    <paper:Citing rdf:resource="#JSP_design"/>
                  </paper:Article>
                </paper:isCited>
                <paper:Citing rdf:resource="#Search_Engine"/>
                <paper:isCited rdf:resource="#Wordnet"/>
              </paper:Article>
            </paper:Citing>
            <paper:isCited rdf:resource="#Search_Engine"/>
            <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >something about how to utilise the language of Java</paper:content>
            <paper:Citing rdf:resource="#Regular_Expression"/>
            <paper:Published>
              <paper:Publication rdf:ID="Machine"/>
            </paper:Published>
            <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ISBN978-7-115-16000-1</paper:ISBN>
            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Java</paper:keywords>
            <paper:Citing rdf:resource="#Modern_Information_Retrival"/>
            <paper:Citing rdf:resource="#Programming_Csharp"/>
            <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Core Java</paper:Title>
          </paper:Article>
        </paper:isCited>
        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >expression</paper:keywords>
        <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >ISBN978-7-115-16000-12</paper:ISBN>
        <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >something about how to design the web with the help of Regular_Expression</paper:content>
        <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >Regular Expression</paper:Title>
        <paper:Citing rdf:resource="#OWL"/>
        <paper:Citing rdf:resource="#Programming_Csharp"/>
      </paper:Article>
    </paper:isCited>
    <paper:Author>
      <paper:Person rdf:ID="Jones"/>
    </paper:Author>
    <paper:Citing rdf:resource="#RDF"/>
    <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >ISBN978-7-115-16000-8</paper:ISBN>
    <paper:Citing rdf:resource="#Computer_Orgnazation"/>
    <paper:isCited rdf:resource="#OWL"/>
    <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >introduce the new concept of ontology</paper:content>
    <paper:isCited rdf:resource="#RDF"/>
    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >ontology</paper:keywords>
    <paper:Published rdf:resource="#Oreilly"/>
    <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Ontology</paper:Title>
  </paper:Article>
</rdf:RDF>

<!-- Created with Protege (with OWL Plugin 2.2, Build 311)  http://protege.stanford.edu -->


--  作者:jpz6311whu
--  发布时间:4/14/2008 3:46:00 PM

--  
main函数呢?
--  作者:icecoolfire
--  发布时间:4/15/2008 2:47:00 PM

--  
import com.hp.hpl.jena.rdf.model.*;

public class Test {
 public static void myTest(String item,String value)
 { 
  String temp = null;
  int citedNumber = 0;
  searchResult mysearch = new searchResult();
  display mydisplay = new display();
  ResIterator result = mysearch.search(item,value);
  while(result.hasNext())
  {
   citedNumber = 0;
   Resource res = result.nextResource();
      
   NodeIterator cited = mydisplay.getIterator(res.toString().split("#")[1],"isCited");
   if(cited!=null)
   {
    while(cited.hasNext())
    {
     temp = cited.next().toString();
     citedNumber=citedNumber+1;     
    }
   }
   else
   {
    System.out.println("cited is null!");
   }
   System.out.print(mysearch.getValue(res,"title"));
   System.out.print("     ");
   System.out.print(mysearch.getValue(res,"author"));
   System.out.print("     ");
   System.out.print("The book is cited "+citedNumber+" times");
   
   System.out.println();
   
  }
 }
 
 public static void main(String[] args)
 {
  String item = "author";
  String value = "Jim";
  myTest(item,value);
 }
}
这里value的值如果是Jack,就可以得到预期结果,如果是Jim则不行。这是为什么呀?


--  作者:jpz6311whu
--  发布时间:4/15/2008 4:31:00 PM

--  
public  ResIterator search(String item,String value){

    Property LookForProperty;
    ResIterator LookForResult=null;
    getInfModel myGet = new getInfModel ();

    LookForProperty=model.getProperty(myGet.itemToProperty(item));
    if(item.equals("author") )
    {
---

这个getInfModel 是什么?代码贴出来看看,是什么样的推理model


--  作者:icecoolfire
--  发布时间:4/15/2008 11:12:00 PM

--  
package zyb;
import com.hp.hpl.jena.rdf.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.ontology.*;
import com.hp.hpl.jena.reasoner.*;
import com.hp.hpl.jena.vocabulary.*;
import com.hp.hpl.jena.reasoner.rulesys.*;
import com.hp.hpl.jena.util.*;
import java.lang.*;
import java.util.*;
import java.io.*;
public class getInfModel {

   public InfModel getAInfModel(){
   InfModel infModel;
      String file = "../../ontology/paper.owl";
      Model data = ModelFactory.createDefaultModel();
      Model model = ModelFactory.createDefaultModel();
      InputStream in ;
     try{
         in = FileManager.get().open( file );
     data.read(in, "");
     }
     catch (Exception e ){}
      Resource configuration=model.createResource() ;
      configuration.addProperty(ReasonerVocabulary.PROPruleMode, "forward");
      configuration.addProperty(ReasonerVocabulary.PROPruleSet,  "../../rules/paper.rules");
      Reasoner reasoner = GenericRuleReasonerFactory.theInstance().create(configuration);
      infModel=ModelFactory.createInfModel(reasoner, data);
   return infModel;
   }
     public String itemToProperty(String item){
   String property=null;
     if (item.equals("title")){
           property="http://www.icecoolfire.com#Title";
       }
       else if(item.equals("ISBN")){
            property="http://www.icecoolfire.com#ISBN";
       }
       else if(item.equals("keywords")){
            property="http://www.icecoolfire.com#keywords";
       }
       else if(item.equals("author")){
            property="http://www.icecoolfire.com#Author";
       }
       else if(item.equals("content") )   {
        property="http://www.icecoolfire.com#content";
       }
       else if(item.equals("pulished") )   {
        property="http://www.icecoolfire.com#Published";
       }
       else if(item.equals("Citing") )   {
               property="http://www.icecoolfire.com#Citing";
           }
//       else if(item.equals("bothCiting") )   {
//            property="http://www.icecoolfire.com#bothCiting";
//                }
       else if(item.equals("isCited"))
       {
        property="http://www.icecoolfire.com#isCited";
       }
       else if(item.equals("indCiting"))
       {
        property="http://www.icecoolfire.com#indCiting";
       }
        else if(item.equals("bothCited") )   {
        property="http://www.icecoolfire.com#bothCited";
       }


   return property;
   }
   public String addNameSpace(String value){
         String result=value;
         result="http://www.owl-ontologies.com/unnamed.owl#" + value;
         return result;
   }
     public String removeType(String sou){
       String result=sou;
       if(sou.indexOf("^^")>0){
       result=sou.substring(0,sou.indexOf("^^"));
       }
       return result;
}
   public String addPrefix(String sou){
   String result=null;
   result="http://www.owl-ontologies.com/unnamed.owl#"+sou;
   return result;
   }
}



--  作者:jpz6311whu
--  发布时间:4/17/2008 11:28:00 AM

--  
rules里面要加这几条:

[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]

[rdfs9:  (?x rdfs:subClassOf ?y), (?a rdf:type ?x) -> (?a rdf:type ?y)]

[sameIndividualAs3: (?X owl:sameAs ?Y), (?X rdf:type owl:Thing), (?Y rdf:type owl:Thing)
                    -> (?X owl:sameIndividualAs ?Y) ]

[sameIndividualAs4: (?X owl:sameIndividualAs ?Y), (?X ?P ?V) -> (?Y ?P ?V) ]

[sameIndividualAs5: (?X owl:sameIndividualAs ?Y), (?V ?P ?X) -> (?V ?P ?Y) ]


--  作者:icecoolfire
--  发布时间:4/17/2008 2:26:00 PM

--  
谢谢jpz6311whu大哥
不过我加了这几条,还是不行,我现在的rules文件是这样的
[indCiting: (?c http://www.icecoolfire.com#Citing ?b),(?b http://www.icecoolfire.com#Citing ?a)->(?c  http://www.icecoolfire.com#indCiting ?a)]

[bothCiting: (?a http://www.icecoolfire.com#Citing ?c),(?b http://www.icecoolfire.com#Citing ?c),notEqual(?a, ?b)->(?a http://www.icecoolfire.com#bothCiting ?b)]

[bothCited: (?a http://www.icecoolfire.com#Citing ?b),(?a http://www.icecoolfire.com#Citing ?c),notEqual(?b, ?c)->(?b  http://www.icecoolfire.com#bothCited ?c)]

[rdfs8:  (?a rdfs:subClassOf ?b), (?b rdfs:subClassOf ?c) -> (?a rdfs:subClassOf ?c)]

[rdfs9:  (?x rdfs:subClassOf ?y), (?a rdf:type ?x) -> (?a rdf:type ?y)]

[sameIndividualAs3: (?X owl:sameAs ?Y), (?X rdf:type owl:Thing), (?Y rdf:type owl:Thing) -> (?X owl:sameIndividualAs ?Y) ]

[sameIndividualAs4: (?X owl:sameIndividualAs ?Y), (?X ?P ?V) -> (?Y ?P ?V) ]

[sameIndividualAs5: (?X owl:sameIndividualAs ?Y), (?V ?P ?X) -> (?V ?P ?Y) ]

您看需不需要在本体文件owl中再进行修改呢?


--  作者:icecoolfire
--  发布时间:4/17/2008 3:25:00 PM

--  
而且不是说,在OWL中,owl:sameAs仅仅是owl:sameIndividualAs的同义词吗,那上面的规则又有什么意义?
--  作者:jpz6311whu
--  发布时间:4/17/2008 7:56:00 PM

--  
我写了一段小demo,你自己研究一下吧:

这个是运行结果:(注意BookInstance的作者即是Jack又是Jim)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance http://www.owl-ontologies.com/Ontology1208422770.owl#Author http://www.owl-ontologies.com/Ontology1208422770.owl#Jack)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance rdf:type http://www.owl-ontologies.com/Ontology1208422770.owl#Book)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance rdf:type rdfs:Resource)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance rdf:type owl:Thing)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance http://www.owl-ontologies.com/Ontology1208422770.owl#Author http://www.owl-ontologies.com/Ontology1208422770.owl#Jim)
   (http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance owl:sameAs http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance)

而本体库内容:(注意本体库中,只有Jack是作者,而Jim和Jack是SameAs关系)
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://www.owl-ontologies.com/Ontology1208422770.owl#"
    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#"
  xml:base="http://www.owl-ontologies.com/Ontology1208422770.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:ID="Book"/>
  <owl:Class rdf:ID="Person"/>
  <owl:ObjectProperty rdf:ID="Author">
    <rdfs:domain rdf:resource="#Book"/>
    <rdfs:range rdf:resource="#Person"/>
  </owl:ObjectProperty>
  <Book rdf:ID="BookInstance">
    <Author>
      <Person rdf:ID="Jack">
        <owl:sameAs>
          <Person rdf:ID="Jim">
            <owl:sameAs rdf:resource="#Jack"/>
          </Person>
        </owl:sameAs>
      </Person>
    </Author>
  </Book>
</rdf:RDF>

源代码也很简单:(注意要用推理OntModelSpec.OWL_DL_MEM_RULE_INF)

public class SameAs {

 public static void main(String[] args) {
  OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF);
  m.read("file:SameAs.owl");
  PrintUtil
    .printOut(m
      .listStatements(
        m
          .getIndividual("http://www.owl-ontologies.com/Ontology1208422770.owl#BookInstance"),
        (Property) null, (RDFNode) null));

 }

}


--  作者:icecoolfire
--  发布时间:4/17/2008 8:03:00 PM

--  
谢谢jpz6311whu大哥,我先研究研究。
--  作者:icecoolfire
--  发布时间:4/17/2008 8:27:00 PM

--  
明白错在哪里啦,原来就因为没用推理OntModelSpec.OWL_DL_MEM_RULE_INF。
谢谢 jpz6311whu 大哥!
--  作者:icecoolfire
--  发布时间:4/17/2008 8:59:00 PM

--  
jpz6311whu大哥,现在又有一个新问题:
如果Tom写了bookA,而Tomson写了bookB,接着用上面的规则定义了Tom owl:sameAs Tomson ,接着我又检索Tom,这样在结果中只有bookA,如何在结果中同时有bookA和bookB呢?我知道sparql可以做到,但如果我只想用listStatements呢,可以做到吗?
--  作者:jpz6311whu
--  发布时间:4/17/2008 9:13:00 PM

--  
其实是一样的问题,你可以做一个这样的本体,然后用我写的demo运行一下试试效果。
--  作者:icecoolfire
--  发布时间:4/17/2008 9:17:00 PM

--  
我试了,不行。检索Tom就只显示bookA,检索Tomson就只显示bookB,不会出现检索其中一个人而同时出现两本书的情况。
--  作者:jpz6311whu
--  发布时间:4/17/2008 9:43:00 PM

--  
你把你的本体库贴出来看看
--  作者:icecoolfire
--  发布时间:4/17/2008 10:12:00 PM

--  
我的本体库如下
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:paper="http://www.icecoolfire.com#"
    xmlns="http://www.owl-ontologies.com/unnamed.owl#"
  xml:base="http://www.owl-ontologies.com/unnamed.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Publication"/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Person"/>
  <owl:Class rdf:about="http://www.icecoolfire.com#Article"/>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Published">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Publication"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Citing">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf>
      <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#isCited"/>
    </owl:inverseOf>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#Author">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Person"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#indCiting">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#bothCited">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#bothCited"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:about="http://www.icecoolfire.com#isCited">
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#Citing"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:ObjectProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#Title">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#ISBN">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#content">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://www.icecoolfire.com#keywords">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:DatatypeProperty>
  <owl:SymmetricProperty rdf:about="http://www.icecoolfire.com#bothCiting">
    <rdfs:domain rdf:resource="http://www.icecoolfire.com#Article"/>
    <owl:inverseOf rdf:resource="http://www.icecoolfire.com#bothCiting"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
    <rdfs:range rdf:resource="http://www.icecoolfire.com#Article"/>
  </owl:SymmetricProperty>
  <paper:Publication rdf:ID="High_education"/>
  <paper:Person rdf:ID="Gary"/>
  <paper:Article rdf:ID="Ontology">
    <paper:isCited>
      <paper:Article rdf:ID="Regular_Expression">
        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >regular</paper:keywords>
        <paper:Author>
          <paper:Person rdf:ID="Peter"/>
        </paper:Author>
        <paper:Published>
          <paper:Publication rdf:ID="People_mail"/>
        </paper:Published>
        <paper:Citing rdf:resource="#Ontology"/>
        <paper:isCited>
          <paper:Article rdf:ID="Core_Java">
            <paper:Author rdf:resource="#Gary"/>
            <paper:Citing>
              <paper:Article rdf:ID="JSP_design">
                <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >JSP</paper:keywords>
                <paper:Author>
                  <paper:Person rdf:ID="Jack">
                    <owl:sameAs>
                      <paper:Person rdf:ID="Jim">
                        <owl:sameAs rdf:resource="#Jack"/>
                      </paper:Person>
                    </owl:sameAs>
                  </paper:Person>
                </paper:Author>
                <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >JSP design</paper:Title>
                <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >ISBN978-7-115-16000-2</paper:ISBN>
                <paper:isCited rdf:resource="#Core_Java"/>
                <paper:Published rdf:resource="#High_education"/>
                <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                >something about how to design the web with the help of JSP language</paper:content>
                <paper:isCited>
                  <paper:Article rdf:ID="Computer_Orgnazation">
                    <paper:isCited rdf:resource="#Ontology"/>
                    <paper:Citing>
                      <paper:Article rdf:ID="Programming_Csharp">
                        <paper:Citing>
                          <paper:Article rdf:ID="ASP.NET">
                            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >asp</paper:keywords>
                            <paper:Author>
                              <paper:Person rdf:ID="Williams">
                                <owl:sameAs>
                                  <paper:Person rdf:ID="Kim">
                                    <owl:sameAs rdf:resource="#Williams"/>
                                  </paper:Person>
                                </owl:sameAs>
                              </paper:Person>
                            </paper:Author>
                            <paper:Citing>
                              <paper:Article rdf:ID="Modern_Information_Retrival">
                                <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >ISBN978-7-115-16000-6</paper:ISBN>
                                <paper:Citing>
                                  <paper:Article rdf:ID="semantic_web">
                                    <paper:content rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >introduce the progess of  semantic web</paper:content>
                                    <paper:Citing>
                                      <paper:Article rdf:ID="Wordnet">
                                        <paper:isCited rdf:resource="#semantic_web"/>
                                        <paper:isCited>
                                          <paper:Article rdf:ID="OWL">
                                            <paper:isCited rdf:resource="#Regular_Expression"/>
                                            <paper:Citing>
                                              <paper:Article rdf:ID="RDF">
                                                <paper:Citing rdf:resource="#Ontology"/>
                                                <paper:content
                                                 rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >introduce the concept of Resource Description Framework</paper:content>
                                                <paper:isCited rdf:resource="#OWL"/>
                                                <paper:isCited rdf:resource="#semantic_web"/>
                                                <paper:Author rdf:resource="#Peter"/>
                                                <paper:Published>
                                                  <paper:Publication rdf:ID="Nature"/>
                                                </paper:Published>
                                                <paper:keywords
                                                 rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >RDF</paper:keywords>
                                                <paper:isCited rdf:resource="#Ontology"/>
                                                <paper:ISBN rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >ISBN978-7-115-16000-10</paper:ISBN>
                                                <paper:Citing rdf:resource="#OWL"/>
                                                <paper:Title rdf:datatype=
                                                "http://www.w3.org/2001/XMLSchema#string"
                                                >RDF</paper:Title>
                                              </paper:Article>
                                            </paper:Citing>
                                            <paper:Citing rdf:resource="#Ontology"/>
                                            <paper:Citing rdf:resource="#Wordnet"/>
                                            <paper:isCited rdf:resource="#semantic_web"/>
                                            <paper:Title rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >OWL</paper:Title>
                                            <paper:Author>
                                              <paper:Person rdf:ID="Tom">
                                                <owl:sameAs>
                                                  <paper:Person rdf:ID="Jones">
                                                    <owl:sameAs rdf:resource="#Tom"/>
                                                  </paper:Person>
                                                </owl:sameAs>
                                              </paper:Person>
                                            </paper:Author>
                                            <paper:content rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >introduce the content of the Ontology Web Language</paper:content>
                                            <paper:ISBN rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >ISBN978-7-115-16000-8</paper:ISBN>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >OWL</paper:keywords>
                                            <paper:isCited rdf:resource="#RDF"/>
                                            <paper:Published>
                                              <paper:Publication rdf:ID="Oreilly"/>
                                            </paper:Published>
                                          </paper:Article>
                                        </paper:isCited>
                                        <paper:Title rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >wordnet</paper:Title>
                                        <paper:Author rdf:resource="#Kim"/>
                                        <paper:isCited rdf:resource="#Programming_Csharp"/>
                                        <paper:isCited>
                                          <paper:Article rdf:ID="Search_Engine">
                                            <paper:Citing rdf:resource="#Wordnet"/>
                                            <paper:isCited rdf:resource="#Programming_Csharp"/>
                                            <paper:Title rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >Search_Engine</paper:Title>
                                            <paper:Citing rdf:resource="#Modern_Information_Retrival"/>
                                            <paper:content rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >tell you how to construct a search engine by yourself</paper:content>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >search</paper:keywords>
                                            <paper:keywords rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >engine</paper:keywords>
                                            <paper:Author rdf:resource="#Peter"/>
                                            <paper:Citing rdf:resource="#Core_Java"/>
                                            <paper:ISBN rdf:datatype=
                                            "http://www.w3.org/2001/XMLSchema#string"
                                            >ISBN978-7-115-16000-5</paper:ISBN>
                                            <paper:Published>
                                              <paper:Publication rdf:ID="Info.Sci."/>
                                            </paper:Published>
                                            <paper:isCited rdf:resource="#JSP_design"/>
                                          </paper:Article>
                                        </paper:isCited>
                                        <paper:Published rdf:resource="#Nature"/>
                                        <paper:Citing rdf:resource="#JSP_design"/>
                                        <paper:content rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >prepared for wordnet</paper:content>
                                        <paper:keywords rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >semantic</paper:keywords>
                                        <paper:ISBN rdf:datatype=
                                        "http://www.w3.org/2001/XMLSchema#string"
                                        >ISBN978-7-115-16000-13</paper:ISBN>
                                      </paper:Article>
                                    </paper:Citing>
                                    <paper:isCited rdf:resource="#Programming_Csharp"/>
                                    <paper:Author rdf:resource="#Jack"/>
                                    <paper:keywords rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >semantic</paper:keywords>
                                    <paper:Citing rdf:resource="#RDF"/>
                                    <paper:keywords rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >web</paper:keywords>
                                    <paper:Citing rdf:resource="#OWL"/>
                                    <paper:isCited rdf:resource="#Modern_Information_Retrival"/>
                                    <paper:Title rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >semantic web</paper:Title>
                                    <paper:Published rdf:resource="#People_mail"/>
                                    <paper:ISBN rdf:datatype=
                                    "http://www.w3.org/2001/XMLSchema#string"
                                    >ISBN978-7-115-16000-7</paper:ISBN>
                                  </paper:Article>
                                </paper:Citing>
                                <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >The book comprises two portions which complement and balance each other.The core portion includes nine chapters authored or coauthored by the designers of the book.The second portion which is fully intergrated with first,is formed by six state-of-the-art charpters written by leading reasearches in their fields.</paper:content>
                                <paper:isCited rdf:resource="#ASP.NET"/>
                                <paper:keywords rdf:datatype=
                                "http://www.w3.org/2001/XMLSchema#string"
                                >information</paper:keywords>
                                <paper:keywords rdf:datatype=
                                "http://www.w3.org/2001/XMLSchema#string"
                                >modern</paper:keywords>
                                <paper:isCited rdf:resource="#Search_Engine"/>
                                <paper:isCited rdf:resource="#Core_Java"/>
                                <paper:Published rdf:resource="#People_mail"/>
                                <paper:Author rdf:resource="#Peter"/>
                                <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                                >Modern_Information_Retrival</paper:Title>
                              </paper:Article>
                            </paper:Citing>
                            <paper:isCited rdf:resource="#Programming_Csharp"/>
                            <paper:Author rdf:resource="#Kim"/>
                            <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >ASP.NET</paper:Title>
                            <paper:Published rdf:resource="#Nature"/>
                            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >net</paper:keywords>
                            <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >something about how to use the language of ASP.NET</paper:content>
                            <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                            >ISBN978-7-115-16000-4</paper:ISBN>
                          </paper:Article>
                        </paper:Citing>
                        <paper:Citing rdf:resource="#Wordnet"/>
                        <paper:isCited rdf:resource="#Core_Java"/>
                        <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >something about how to utilise the language of Csharp</paper:content>
                        <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >Programming Csharp</paper:Title>
                        <paper:Author>
                          <paper:Person rdf:ID="James"/>
                        </paper:Author>
                        <paper:Citing rdf:resource="#Search_Engine"/>
                        <paper:isCited rdf:resource="#Regular_Expression"/>
                        <paper:Published rdf:resource="#Oreilly"/>
                        <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >ISBN978-7-115-16000-3</paper:ISBN>
                        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >Csharp</paper:keywords>
                        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                        >programming</paper:keywords>
                        <paper:isCited rdf:resource="#Computer_Orgnazation"/>
                        <paper:Citing rdf:resource="#semantic_web"/>
                      </paper:Article>
                    </paper:Citing>
                    <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >ISBN978-7-115-16000-11</paper:ISBN>
                    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >computer</paper:keywords>
                    <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >something about the compouter</paper:content>
                    <paper:Author rdf:resource="#Jack"/>
                    <paper:Published rdf:resource="#People_mail"/>
                    <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >computer orgnazation</paper:Title>
                    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
                    >orgnazation</paper:keywords>
                    <paper:Citing rdf:resource="#JSP_design"/>
                  </paper:Article>
                </paper:isCited>
                <paper:Citing rdf:resource="#Search_Engine"/>
                <paper:isCited rdf:resource="#Wordnet"/>
              </paper:Article>
            </paper:Citing>
            <paper:isCited rdf:resource="#Search_Engine"/>
            <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >something about how to utilise the language of Java</paper:content>
            <paper:Citing rdf:resource="#Regular_Expression"/>
            <paper:Published>
              <paper:Publication rdf:ID="Machine"/>
            </paper:Published>
            <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >ISBN978-7-115-16000-1</paper:ISBN>
            <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Java</paper:keywords>
            <paper:Citing rdf:resource="#Modern_Information_Retrival"/>
            <paper:Citing rdf:resource="#Programming_Csharp"/>
            <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
            >Core Java</paper:Title>
          </paper:Article>
        </paper:isCited>
        <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >expression</paper:keywords>
        <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >ISBN978-7-115-16000-12</paper:ISBN>
        <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >something about how to design the web with the help of Regular_Expression</paper:content>
        <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
        >Regular Expression</paper:Title>
        <paper:Citing rdf:resource="#OWL"/>
        <paper:Citing rdf:resource="#Programming_Csharp"/>
      </paper:Article>
    </paper:isCited>
    <paper:Author rdf:resource="#Jones"/>
    <paper:Citing rdf:resource="#RDF"/>
    <paper:ISBN rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >ISBN978-7-115-16000-8</paper:ISBN>
    <paper:Citing rdf:resource="#Computer_Orgnazation"/>
    <paper:isCited rdf:resource="#OWL"/>
    <paper:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >introduce the new concept of ontology</paper:content>
    <paper:isCited rdf:resource="#RDF"/>
    <paper:keywords rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >ontology</paper:keywords>
    <paper:Published rdf:resource="#Oreilly"/>
    <paper:Title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Ontology</paper:Title>
  </paper:Article>
</rdf:RDF>

<!-- Created with Protege (with OWL Plugin 2.2, Build 311)  http://protege.stanford.edu -->

其中Tom写了《OWL》这本书,Jones写了《Ontology》这本书,然后定义Tom和Jones是owl:sameAs的.


--  作者:icecoolfire
--  发布时间:4/18/2008 7:44:00 PM

--  
又试了试,还是不行啊。检索Tom就显示OWL,检索Jones就显示Ontology,而不会同时显示出来。
--  作者:jpz6311whu
--  发布时间:4/19/2008 1:04:00 PM

--  
有点麻烦,我再调一下
--  作者:icecoolfire
--  发布时间:4/23/2008 10:50:00 AM

--  
比如说下面是一篇论文中的参考文献,应该怎样把这篇参考文献的题目(也就是《The INQUERY Retrieval System, in: Proceedings of the Third International conference on Database and Expert System Applications》)提取出来呢?

[51] J.P. Callan, W.B. Croft and S.M. Harding, The INQUERY Retrieval System, in: Proceedings of the Third International conference on Database and Expert System Applications,Springer, 1992, 78–83.


--  作者:buyimazi
--  发布时间:11/17/2008 10:23:00 AM

--  
我想要输出A SAMEAS B
--  作者:baojie
--  发布时间:11/19/2008 4:09:00 AM

--  
没有什么owl:sameIndividualAs
--  作者:wjwenoch
--  发布时间:11/19/2008 10:10:00 AM

--  
owl:sameIndividualAs貌似是1.0中的。。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
468.750ms