owlvocabularyexplanationdeposit.java
来自「Semantic Web Ontology Editor」· Java 代码 · 共 722 行 · 第 1/5 页
JAVA
722 行
/* * Created on Feb 24, 2005 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */package org.mindswap.swoop.utils.explain;import java.net.URI;import java.net.URISyntaxException;import java.util.Hashtable;import org.semanticweb.owl.io.vocabulary.OWLVocabularyAdapter;/** * @author Dave * * Deposit of OWL vocabulary explanations * */public class OWLVocabularyExplanationDeposit extends Hashtable implements VocabularyExplanationDeposit { private static URI OWL_REF = null; private static OWLVocabularyExplanationDeposit myDeposit = null; private int myNumExplanations = 0; public static OWLVocabularyExplanationDeposit getInstance() { if (myDeposit == null) { try { OWL_REF = new URI("http://www.w3.org/TR/owl-ref/"); myDeposit = new OWLVocabularyExplanationDeposit(); } catch (URISyntaxException e) { e.printStackTrace(); } } return myDeposit; } private OWLVocabularyExplanationDeposit() throws URISyntaxException { URI [] sources = { OWL_REF }; // OWL classes String name = OWLVocabularyAdapter.OWL + "AllDifferent"; add( new OWLVocabularyExplanation( new URI(name), name, "<p>For ontologies in which the unique-names assumption holds, the use of <code>owl:differentFrom</code> is likely to lead to a large number of statements, as all individuals have to be declared pairwise disjoint. For such situations OWL provides a special idiom in the form of the construct owl:AllDifferent. <code>owl:AllDifferent</code> is a special built-in OWL class, for which the property owl:distinctMembers <a name=\"distinctMembers-def\" id=\"distinctMembers-def\"></a> is defined, which links an instance of <code>owl:AllDifferent</code> to a list of individuals. The intended meaning of such a statement is that all individuals in the list are all different from each other.</p>" + "<p>An example:</p>" + "<p><owl:AllDifferent><br>" + TAB + " <owl:distinctMembers rdf:parseType=\"Collection\"><br>" + TAB+TAB+" <Opera rdf:about=\"#Don_Giovanni\"/><br>" + TAB+TAB+" <Opera rdf:about=\"#Nozze_di_Figaro\"/><br>" + TAB+TAB+" <Opera rdf:about=\"#Cosi_fan_tutte\"/><br>" + TAB+TAB+" <Opera rdf:about=\"#Tosca\"/><br>" + TAB+TAB+" <Opera rdf:about=\"#Turandot\"/><br>" + TAB+TAB+" <Opera rdf:about=\"#Salome\"/><br>" + TAB+TAB+" </owl:distinctMembers><br>" + TAB+" </owl:AllDifferent><br> </p>" + "<p>This states that these six URI references all point to different operas. </p>", sources, OWL_REF, null) ); name = OWLVocabularyAdapter.OWL + "AnnotationProperty"; URI [] sources_AP = { new URI("http://www.w3.org/TR/owl-ref/#AnnotationProperty-def"), new URI("http://www.w3.org/TR/2004/REC-owl-guide-20040210/#owl_AnnotationProperty") }; add( new OWLVocabularyExplanation( new URI(name), name, "<p>Properties that are used as annotations should be declared using owl:AnnotationProperty. E.g.</p>" + "<p> <owl:AnnotationProperty rdf:about=\"&dc;creator\" /> </p>" + "<p>In addition, the following restrictions apply</p>" + "<ul>" + "<li>Annotation properties must have an explicit <a name=\"AnnotationProperty-def\">typing triple</a> of the form: <p>AnnotationPropertyID rdf:type owl:AnnotationProperty . </p> </li>" + "<li>Annotation properties must not be used in property axioms. Thus, in OWL DL one cannot define subproperties or domain/range constraints for annotation properties.</li>" + "<li>The object of an annotation property must be either a data literal, a URI reference, or an individual.</li>" + "</ul>", sources_AP, OWL_REF, null) ); name = OWLVocabularyAdapter.OWL + "Class"; add( new OWLVocabularyExplanation( new URI(name), name, "<p>Class descriptions form the building blocks for defining classes through class axioms. The simplest form of a class axiom is a class description of type 1, It just states the existence of a class, using <a name=\"Class-def\" id=\"Class-def\"><code>owl:Class</code></a> with a class identifier.</p> <p>For example, the following class axiom declares the URI reference <code>#Human</code> to be the name of an OWL class:</p><br> <owl:Class rdf:ID=\"Human\"/> " + "<p>This is correct OWL, but does not tell us very much about the class <code>Human</code>. Class axioms typically contain additional components that state necessary and/or sufficient characteristics of a class. OWL contains three language constructs for combining class descriptions into class axioms:</p>" + "<ul>" + "<li><a href=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\"><code>rdfs:subClassOf</code></a> allows one to say that the class extension of a class description is a subset of the class extension of another class description.</li>" + "<li><a href=\"http://www.w3.org/2002/07/owl#equivalentClass\"><code>owl:equivalentClass</code></a> allows one to say that a class description has exactly the same class extension as another class description.</li>" + "<li><a href=\"http://www.w3.org/2002/07/owl#disjointWith\"><code>owl:disjointWith</code></a> allows one to say that the class extension of a class description has no members incommon with the class extension of another class description.</li>" + " </ul>" + "<p>Syntactically, these three language constructs are properties that have a class description as both domain and range. We discuss these properties in more detail in the following subsections.</p>" + "<p>In addition, OWL allows class axioms in which a class description of the enumeration or the set-operator type is given a name. These class axioms are semantically equivalent to class axioms with a <code>owl:equivalentClass</code> statement, so these will be discussed right after that subsection.</p>", sources, OWL_REF, null) ); name = OWLVocabularyAdapter.OWL + "DataRange"; //name = OWLVocabularyAdapter.OWL + "Class"; add( new OWLVocabularyExplanation( new URI(name), name, "<p>In addition to the RDF datatypes, OWL provides one additional construct for defining a range of data values, namely an enumerated datatype. This datatype format makes use of the owl:oneOf construct, that is also used for describing an enumerated class. In the case of an enumerated datatype, the subject of owl:oneOf is a blank node of class owl:DataRange and the object is a list of literals. Unfortunately, we cannot use the rdf:parseType=\"Collection\" idiom for specifying the literal list, because RDF requires the collection to be a list of RDF node elements. Therefore we have to specify the list of data values with the basic list constructs rdf:first, rdf:rest and rdf:nil.</p>" + "<p>NOTE: Enumerated datatypes are not part of OWL Lite.</p>" + "<p>The example below specifies the range of the property tennisGameScore to be the list of integer values {0, 15, 30, 40}:.</p>" + "<p><owl:DatatypeProperty rdf:ID=\"tennisGameScore\"></p>" + TAB+"<rdfs:range><br>" + TAB+TAB+"<owl:DataRange><br>" + TAB+TAB+TAB+"<owl:oneOf><br>" + TAB+TAB+TAB+TAB+"<rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:first rdf:datatype=\"&xsd;integer\">0</rdf:first><br>" + TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:rest><br>" + TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:first rdf:datatype=\"&xsd;integer\">15</rdf:first><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:rest><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:first rdf:datatype=\"&xsd;integer\">30</rdf:first><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:rest><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:first rdf:datatype=\"&xsd;integer\">40</rdf:first><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"<rdf:rest rdf:resource=\"&rdf;nil\" /><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"</rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"</rdf:rest><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+TAB+"</rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+TAB+TAB+"</rdf:rest><br>" + TAB+TAB+TAB+TAB+TAB+TAB+"</rdf:List><br>" + TAB+TAB+TAB+TAB+TAB+"</rdf:rest><br>" + TAB+TAB+TAB+TAB+"</rdf:List><br>" + TAB+TAB+TAB+"</owl:oneOf><br>" + TAB+TAB+"</owl:DataRange><br>" + TAB+"</rdfs:range><br>" + "</owl:DatatypeProperty><br>", sources, OWL_REF, null) ); name = OWLVocabularyAdapter.OWL + "DatatypeProperty"; URI [] sources_DT = { new URI("http://www.w3.org/TR/2004/REC-owl-guide-20040210/#owl_DatatypeProperty") }; add( new OWLVocabularyExplanation( new URI(name), name, "We distinguish properties according to whether they relate individuals to individuals (object properties) or individuals to datatypes (datatype properties). Datatype properties may range over RDF literals or simple types defined in accordance with http://www.w3.org/TR/xmlschema-2/ -- XML Schema datatypes. </p>" + "<p> <a id=\"owl_DatatypeProperty\" name=\"owl_DatatypeProperty\"></a> OWL uses most of the built-in XML Schema datatypes. References to these datatypes are by means of the URI reference for the datatype, <tt>http://www.w3.org/2001/XMLSchema</tt>. The following datatypes are <em>recommended</em> for use with OWL: </p><br>" + "xsd:string, xsd:normalizedString, xsd:boolean, xsd:decimal, xsd:float, xsd:double, xsd:integer, xsd:nonNegativeInteger" + "xsd:positiveInteger, xsd:nonPositiveInteger, xsd:negativeInteger, xsd:long, xsd:int, xsd:short, xsd:byte, xsd:unsignedLong, xsd:unsignedInt, xsd:unsignedShort, xsd:unsignedByte" + "xsd:hexBinary, xsd:base64Binary, xsd:dateTime, xsd:time, xsd:date, xsd:gYearMonth, xsd:gYear, xsd:gMonthDay, xsd:gDay, xsd:gMonth, " + "xsd:anyURI, xsd:token, xsd:language, xsd:NMTOKEN, xsd:Name, xsd:NCName" + "<p>" + "The above datatypes, plus <tt>rdfs:Literal</tt>, form the built-in OWL datatypes." + "All OWL reasoners are required to support the <tt>xsd:integer</tt>" + "and <tt>xsd:string</tt> datatypes." + "</p>" + "<p>Other built-in XML Schema datatypes may be used in OWL Full, but with caveats described in the http://www.w3.org/TR/2004/REC-owl-semantics-20040210/syntax.html -- OWL Semantics and Abstract Syntax</a> documentation </p><br>" + "<owl:Class rdf:ID=\"VintageYear\" /><br>" + "<owl:DatatypeProperty rdf:ID=\"yearValue\"><br>"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?