1 Reply Latest reply on Jan 3, 2008 4:45 PM by alwu-Oracle

    Inferencing: Where am I going wrong?

    610533
      I have an owl class "foaf:Person" in my 11g database with 500 instances of people connected to it via rdf:type foaf:Person.
      Some of those people have an object property "isManagerOf" pointing to a foaf:Person.
      All of this is fine. Everything works and I can navigate around the instances in the database using TopBraidComposer.

      Now I want to Create a new owl class called "Manager".
      OK so I do this in TBC and save it.

      I set the owl:equivilantClass in TBC for Manager to be
      foaf:Person and (people:isManagerOf some foaf:Person)

      I then run
      exec sem_apis.create_entailment('rsdata_owl_idx', sem_models('rsdata'), sem_rulebases('OWLPRIME'));
      And then I try to select the managers

      SELECT y
      FROM TABLE(SEM_MATCH('(?y rdf:type <http://www.myco.com/data/company#Manager>)',
      SEM_Models('rsdata'),
      sem_rulebases('OWLPRIME'),
      null,
      null));

      I do not retrieve any results. Why Not?

      I have got this to work using rulebases
      I create a rulebase and add a rule

      INSERT INTO mdsys.semr_rsdata_rb VALUES(
      'manager_rule',
      '(?x <http://www.myco.com/data/people#isManagerOf> ?y)',
      NULL,
      '(?x rdf:type <http://www.myco.com/data/company#Manager>)',
      null);

      I then create a rules index
      BEGIN
      SEM_APIS.CREATE_RULES_INDEX(
      'rdfs_rix_rsdata',
      SEM_Models('rsdata'),
      SEM_Rulebases('rsdata_rb'));
      END;

      And then run the select statement.

      SELECT y
      FROM TABLE(SEM_MATCH('(?y rdf:type <http://www.myco.com/data/company#Manager>)',
      SEM_Models('rsdata'),
      sem_rulebases('rsdata_rb'),
      null,
      null));

      I see a list of the people who are managers.

      Any help as to why the first approach does not work would be of great help.

      Cheers

      Phil
        • 1. Re: Inferencing: Where am I going wrong?
          alwu-Oracle
          This is a summary based on our email conversation.

          OWLPrime does not directly support intersectionOf and that is why you see no matches.

          A workaround is to define a named class, say ManagerOfPerson, for (people:isManagerOf some foaf:Person)
          and then add the following to your ontology

          Manager rdfs:subClassOf foaf:Person .
          Manager rdfs:subClassOf ManagerOfPerson

          and a user-defined rule to rsdata_rb in Oracle 11g saying that
          if
          x rdf:type foaf:Person and x rdf:type ManagerOfPerson,
          then
          x rdf:type ManagerOfPerson

          Then you can run inference command (in one line please)
          exec sem_apis.create_entailment('rsdata_owl_idx', sem_models('rsdata'), sem_rulebases('OWLPRIME', 'rsdata_rb'), SEM_APIS.REACH_CLOSURE, null, 'USER_RULES=T');


          Alternatively, in this particular case, you can define Manager like the following.
          Then, using OWLPrime by itself, you can get the fact that "Mary rdf:type Manager"

          <?xml version="1.0"?>
          <!DOCTYPE owl [
          <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
          <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
          <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
          <!ENTITY people "http://a/b/people/" >
          ]>

          <rdf:RDF
          xml:base="http://a/b/people#"
          xmlns:people="http://a/b/people#"
          xmlns="http://a/b/people#"
          xmlns:owl = "http://www.w3.org/2002/07/owl#"
          xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:foaf="http://xmlns.com/foaf/0.1/"
          xmlns:rdfs= "http://www.w3.org/2000/01/rdf-schema#"
          xmlns:xsd = "http://www.w3.org/2001/XMLSchema#">
          <owl:Ontology rdf:about=""/>
          <owl:Class rdf:ID="Manager">
          <owl:equivalentClass>
          <owl:Restriction>
          <owl:onProperty rdf:resource="#isManagerOf"/>
          <owl:someValuesFrom rdf:resource="&foaf;Person"/>
          </owl:Restriction>
          </owl:equivalentClass>
          <rdfs:subClassOf rdf:resource="&foaf;Person"/>
          </owl:Class>

          <owl:ObjectProperty rdf:ID="isManagerOf"/>
          <foaf:Person rdf:ID="Mary">
          <people:isManagerOf rdf:resource="#Jack"/>
          </foaf:Person>
          <foaf:Person rdf:ID="Jack"/>
          </rdf:RDF>

          A third option is to use Pellet together with Oracle Jena Adaptor.