/** * @param subject the subject * @param subjectAnon whether the subject is anonymous * @param axiom true if axiom * @param predicate the predicate * @param object the object */ public RDFTriple(IRI subject, boolean subjectAnon, boolean axiom, IRI predicate, OWLLiteral object) { this(getResource(subject, subjectAnon, axiom), new RDFResourceIRI(predicate), new RDFLiteral(object)); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }
public OWLOntologyFormat parse(IRI documentIRI, OWLOntology ontology) throws OWLParserException, IOException, UnloadableImportException { return parse(new IRIDocumentSource(documentIRI), ontology); } }
private void rebuildAnonRoots() { rootAnonymousNodes.clear(); for (RDFTriple triple : triples) { if (triple.getSubject().isAnonymous()) { rootAnonymousNodes.add((RDFResourceBlankNode) triple.getSubject()); } } for (RDFTriple triple : triples) { if (triple.getObject().isAnonymous() && !triple.isSubjectSameAsObject()) { rootAnonymousNodes.remove(triple.getObject()); } } }
/** * @return true if an id is required for this node - only if this is an individual or an axiom * and id is required */ public boolean idRequiredForIndividualOrAxiom() { return isAnonymous() && (isIndividual() || isAxiom()) && shouldOutputId(); } }
private RDFTriple getRDFTriple(IRI subject, IRI predicate, OWLLiteral object) { return new RDFTriple(getRDFResource(subject), new RDFResourceIRI(predicate), new RDFLiteral(object)); }
@Override public String toString() { return ToStringRenderer.getRendering(this); } }
/** * @param target a document target */ public StringDocumentSource(StringDocumentTarget target) { this(target.toString()); }
@Override public void characters(char[] data, int start, int length) { XMLUtils.escapeXML(data, start, length, m_content); } }
/** * Deterimines if a character is an NCName (Non-Colonised Name) start character. * * @param codePoint The code point of the character to be tested. For UTF-8 and UTF-16 * characters the code point corresponds to the value of the char that represents the * character. * @return {@code true} if {@code codePoint} is a NCName start character, otherwise {@code * false}. */ public static boolean isNCNameStartChar(int codePoint) { return codePoint != ':' && isXMLNameStartCharacter(codePoint); }
/** * Deterimines if a character is an NCName (Non-Colonised Name) character. * * @param codePoint The code point of the character to be tested. For UTF-8 and UTF-16 * characters the code point corresponds to the value of the char that represents the * character. * @return {@code true} if {@code codePoint} is a NCName character, otherwise {@code false}. */ public static boolean isNCNameChar(int codePoint) { return codePoint != ':' && isXMLNameChar(codePoint); }
/** * Determines if a character sequence has a suffix that is an NCName. * * @param s The character sequence. * @return {@code true} if the character sequence {@code s} has a suffix that is an NCName. */ public static boolean hasNCNameSuffix(CharSequence s) { return getNCNameSuffixIndex(s) != -1; }
/** * Determines if a character sequence is a QName. A QName is either an NCName (LocalName), or an * NCName followed by a colon followed by another NCName (where the first NCName is referred to * as the 'Prefix Name' and the second NCName is referred to as the 'Local Name' - i.e. * PrefixName:LocalName). * * @param s The character sequence to be tested. * @return {@code true} if {@code s} is a QName, otherwise {@code false}. */ public static boolean isQName(CharSequence s) { return isQName(s, 0); }
/** * Constructs an input source which will read an ontology from a * representation from the specified file. * * @param is The stream that the ontology representation will be read from. */ public GZipStreamDocumentSource(InputStream is) { super("gzipinputstream:ontology", null, null); readIntoBuffer(is); }
private void rebuildAnonRoots() { rootAnonymousNodes.clear(); for (RDFTriple triple : triples) { if (triple.getSubject().isAnonymous()) { rootAnonymousNodes.add((RDFResourceBlankNode) triple.getSubject()); } } for (RDFTriple triple : triples) { if (triple.getObject().isAnonymous() && !triple.isSubjectSameAsObject()) { rootAnonymousNodes.remove(triple.getObject()); } } }
/** * @param subject the subject * @param subjectAnon whether the subject is anonymous * @param axiom true if axiom * @param predicate the predicate * @param object the object */ public RDFTriple(IRI subject, boolean subjectAnon, boolean axiom, IRI predicate, OWLLiteral object) { this(getResource(subject, subjectAnon, axiom), new RDFResourceIRI(predicate), new RDFLiteral(object)); }
private RDFTriple getRDFTriple(IRI subject, IRI predicate, OWLLiteral object) { return new RDFTriple(getRDFResource(subject), new RDFResourceIRI(predicate), new RDFLiteral(object)); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }
/** * @param subject the subject * @param subjectAnon whether the subject is anonymous * @param axiom true if axiom * @param predicate the predicate * @param object the object */ public RDFTriple(IRI subject, boolean subjectAnon, boolean axiom, IRI predicate, OWLLiteral object) { this(getResource(subject, subjectAnon, axiom), new RDFResourceIRI(predicate), new RDFLiteral(object)); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }