RDFSLiteral() { super( ATermUtils.makeTermAppl(Namespaces.RDFS + "Literal"), // new Datatype[] { RDFSPlainLiteral.instance, RDFSTypedLiteral.instance }); new Datatype[] { XSDSimpleType.instance, RDFXMLLiteral.instance, UnknownDatatype.instance }); }
public boolean isBnode() { return ATermUtils.isBnode( name ); }
public ATermAppl getCanonicalRepresentation(ATermAppl input) throws InvalidLiteralException { if( !ATermUtils.isLiteral( input ) ) throw new IllegalArgumentException(); if( !name.equals( input.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) throw new IllegalArgumentException(); return input; }
private static void addTo(Map<ATermAppl, ATermAppl> map, ATermAppl roleName, Set<ATermAppl> asserted) { if (asserted.isEmpty()) return; ATermAppl range = null; if (asserted.size() == 1) { range = asserted.iterator().next(); } else { range = ATermUtils.makeAnd(ATermUtils.toSet(asserted)); } range = ELSyntaxUtils.simplify( ATermUtils.nnf( range ) ); map.put(roleName, range); }
ATermAppl c = ATermUtils.makeTermAppl( "_C_" ); ATermAppl notC = ATermUtils.makeNot( c ); test = ATermUtils.makeAnd( ATermUtils.makeSomeValues( sub, c ), ATermUtils .makeAllValues( sup, notC ) ); .makeLiteral( ATermUtils.makeAnonNominal( Integer.MAX_VALUE ) ); test = ATermUtils.makeAnd( ATermUtils.makeHasValue( sub, anon ), ATermUtils .makeAllValues( sup, ATermUtils.makeNot( ATermUtils.makeValue( anon ) ) ) );
String datatypeURI = l.getDatatypeURI(); if(datatypeURI != null) aTerm = ATermUtils.makeTypedLiteral(l.getString(), datatypeURI); else aTerm = ATermUtils.makePlainLiteral(l.getString(), l.getLanguage()); aTerm = ATermUtils.makeAnd(list); aTerm = ATermUtils.makeOr(list); for(ATermList l = list; !l.isEmpty(); l = l.getNext()) { ATermAppl c = (ATermAppl) l.getFirst(); ATermAppl nominal = ATermUtils.makeValue(c); result = result.insert(nominal); aTerm = ATermUtils.makeOr(result); aTerm = ATermUtils.makeNot(complement); aTerm = ATermUtils.makeBnode(r.getId().toString()); aTerm = ATermUtils.makeTermAppl(r.getURI());
hasObject( node, RDF.type.asNode(), OWL.Class.asNode() ); aTerm = ATermUtils.makeAnd( list ); hasObject( node, RDF.type.asNode(), OWL.Class.asNode() ); aTerm = ATermUtils.makeOr( list ); ATermAppl c = (ATermAppl) l.getFirst(); if( PelletOptions.USE_PSEUDO_NOMINALS ) { ATermAppl nominal = ATermUtils.makeTermAppl( c.getName() + "_nominal" ); result = result.insert( nominal ); ATermAppl nominal = ATermUtils.makeValue( c ); result = result.insert( nominal ); aTerm = ATermUtils.makeOr( result ); hasObject( node, RDF.type.asNode(), OWL.Class.asNode() ); aTerm = ATermUtils.makeNot( complement ); aTerm = ATermUtils.makeVar( node.getName() ); aTerm = ATermUtils.makeBnode( node.getBlankNodeId().toString() ); aTerm = ATermUtils.makeTermAppl( uri );
private boolean absorbVII(Set<ATermAppl> set) { ATermList list = ATermUtils.makeList( set ); ATermAppl sub = ATermUtils.nnf( (ATermAppl) list.getFirst() ); list = list.getNext(); ATermAppl sup = list.isEmpty() ? ATermUtils.makeNot( sub ) : ATermUtils.makeNot( ATermUtils.makeAnd( list ) ); sup = ATermUtils.nnf( sup ); ATermAppl subClassAxiom = ATermUtils.makeSub( sub, sup ); if( log.isLoggable( Level.FINE ) ) log.fine( "GCI: " + subClassAxiom + "\nexplanation: " + explanation ); addDef( subClassAxiom ); tbox.addAxiomExplanation( subClassAxiom, explanation ); return true; }
return ATermUtils.makeBnode( node.getBlankNodeLabel() ); return ATermUtils.makeTermAppl( node.getURI() ); return ATermUtils.makeVar( node.getName() );
/** * Create an all values restriction. * * @param r property term * @param c class or datatype term * @return an ATermAppl in the form all(r,c) */ public static ATermAppl all(ATermAppl r, ATermAppl c) { return ATermUtils.makeAllValues( r, c ); }
return ATermUtils.makeMin( pt, cardinality, c ); else if( restrictionType.equals( OWL.maxCardinality.asNode() ) || restrictionType.equals( OWL2.maxQualifiedCardinality.asNode() ) ) return ATermUtils.makeMax( pt, cardinality, c ); else return ATermUtils.makeCard( pt, cardinality, c ); } catch( Exception ex ) { log.log( Level.WARNING, "Invalid cardinality", ex );
public void removeDatatype( String name ) { Datatype dt = getDatatype( name ); // clean up the cached results uriToDatatype.remove( name ); datatypeToURI.remove( dt ); normalized.remove( dt ); ATermAppl term = ATermUtils.makeTermAppl( name ); termToDatatype.remove( term ); ATermAppl not = ATermUtils.makeNot( term ); termToDatatype.remove( not ); }
public static ATermAppl inv(ATermAppl r) { return ATermUtils.makeInv( r ); }
public NodeSet<OWLClass> getObjectPropertyRanges(OWLObjectPropertyExpression pe, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { ATermAppl some = ATermUtils.makeSomeValues(ATermUtils.makeInv(term(pe)), ATermUtils.TOP); Set<ATermAppl> equivalents = kb.getEquivalentClasses(some); if (direct && !equivalents.isEmpty()) { return toClassNodeSet(Collections.singleton(equivalents)); } Set<Set<ATermAppl>> result = kb.getSuperClasses( some, direct ); if (!equivalents.isEmpty()) { result.add(equivalents); } return toClassNodeSet(result); } catch( PelletRuntimeException e ) { throw convert( e ); } }
public boolean hasPropertyValue(ATermAppl s, ATermAppl p, ATermAppl o) { Bool hasObviousValue = hasObviousPropertyValue( s, p, o ); if( hasObviousValue.isKnown() ) { if( hasObviousValue.isFalse() || !doExplanation() ) { return hasObviousValue.isTrue(); } } ATermAppl c = null; if( o == null ) { if( kb.isDatatypeProperty( p ) ) { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP_LIT ); } else { c = ATermUtils.makeMin( p, 1, ATermUtils.TOP ); } } else { c = ATermUtils.makeHasValue( p, o ); } boolean isType = isType( s, c ); return isType; }
private static boolean isDatatypeProperty(ATermAppl t, KnowledgeBase kb) { if( !ATermUtils.isVar( t ) && !kb.isDatatypeProperty( t ) ) { if( log.isLoggable( Level.WARNING ) ) log.warning( "Undefined datatype property used in query: " + t ); return false; } return true; }
public static ATermAppl hasValue(ATermAppl r, ATermAppl ind) { return ATermUtils.makeHasValue( r, ind ); }