コード例 #1
0
 public List<DataPropertyStatement> getDataPropertyStatements(
     DataProperty dp, int startIndex, int endIndex) {
   getOntModel().enterCriticalSection(Lock.READ);
   List<DataPropertyStatement> dpss = new ArrayList<DataPropertyStatement>();
   try {
     Property prop = ResourceFactory.createProperty(dp.getURI());
     ClosableIterator dpsIt = getOntModel().listStatements(null, prop, (Literal) null);
     try {
       int count = 0;
       while ((dpsIt.hasNext()) && ((endIndex < 0) || (count < endIndex))) {
         ++count;
         Statement stmt = (Statement) dpsIt.next();
         if (startIndex < 0 || startIndex <= count) {
           Literal lit = (Literal) stmt.getObject();
           DataPropertyStatement dps = new DataPropertyStatementImpl();
           dps.setDatapropURI(dp.getURI());
           dps.setIndividualURI(stmt.getSubject().getURI());
           fillDataPropertyStatementWithJenaLiteral(dps, lit);
           dpss.add(dps);
         }
       }
     } finally {
       dpsIt.close();
     }
   } finally {
     getOntModel().leaveCriticalSection();
   }
   return dpss;
 }
コード例 #2
0
 @Override
 public List<Literal> getDataPropertyValuesForIndividualByProperty(
     Individual subject, DataProperty property) {
   return getDataPropertyValuesForIndividualByProperty(subject.getURI(), property.getURI());
 }
コード例 #3
0
 public void deleteDataPropertyStatementsForIndividualByDataProperty(
     Individual individual, DataProperty dataProperty) {
   this.deleteDataPropertyStatementsForIndividualByDataProperty(
       individual.getURI(), dataProperty.getURI());
 }