Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Interested in an NPE ?
- 5.5.0.Final
- in class NamedEntryPoint :
- protected FactHandle insert(final Object object,
- final Object tmsValue,
- final boolean dynamic,
- boolean logical,
- final Rule rule,
- final Activation activation) throws FactException {
- if ( object == null ) {
- // you cannot assert a null object
- return null;
- }
- try {
- this.wm.startOperation();
- ObjectTypeConf typeConf = this.typeConfReg.getObjectTypeConf( this.entryPoint,
- object );
- if ( logical && !typeConf.isTMSEnabled()) {
- enableTMS(object, typeConf);
- }
- InternalFactHandle handle = null;
- if ( this.wm.isSequential() ) {
- handle = createHandle( object,
- typeConf );
- insert( handle,
- object,
- rule,
- activation,
- typeConf );
- return handle;
- }
- try {
- this.lock.lock();
- this.ruleBase.readLock();
- // check if the object already exists in the WM
- handle = this.objectStore.getHandleForObject( object );
- if ( typeConf.isTMSEnabled() ) {
- EqualityKey key;
- TruthMaintenanceSystem tms = wm.getTruthMaintenanceSystem();
- if ( handle == null ) {
- // lets see if the object is already logical asserted
- key = tms.get( object );
- } else {
- // Object is already asserted, so check and possibly correct its
- // status and then return the handle
- key = handle.getEqualityKey();
- if ( key.getStatus() == EqualityKey.STATED ) {
- // key == null here !!!!!!!!!!!!!!!!!!!
- // conf.setAssertBehaviour( AssertBehaviour.EQUALITY );
- // inserting Triple :
- <file:/home/jmv/src/eulergui-code/eulergui/test/import.n3p.n3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .
- that is already present.
- And the rule is :
- // ---------- N3 rule 9 ----------
- /* {
- ?ONTO <http://www.w3.org/2002/07/owl#imports> ?X.
- }
- => {
- ?ONTO <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology>.
- }. */
- rule "project-java-rules.n3 9"
- when
- $Triple_1 : Triple( $ONTO : subject, predicate == "<http://www.w3.org/2002/07/owl#imports>", $X : object )
- then
- Triple newTriple;
- TripleResult newTripleResult;
- newTriple = new Triple( );
- newTriple.setSubject( $ONTO );
- newTriple.setPredicate( "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>".toString() );
- newTriple.setObject( "<http://www.w3.org/2002/07/owl#Ontology>" ); insertLogical( newTriple );
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement