I have a simple ontology designed using Protégé 3.4. I've introduced some "Necessary & Sufficient" conditions, like in the defintion of the Table class:
http://postimage.org/image/f37xliqad/
Forget the two first conditions, the third one is easier to understand :)
The OWL code generated is:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"
xmlns:assert="http://www.owl-ontologies.com/assert.owl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:sqwrl="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#"
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
xmlns="http://www.owl-ontologies.com/Ontology1317586695.owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:swrla="http://swrl.stanford.edu/ontologies/3.3/swrla.owl#"
xml:base="http://www.owl-ontologies.com/Ontology1317586695.owl">
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="http://swrl.stanford.edu/ontologies/3.3/swrla.owl"/>
<owl:imports rdf:resource="http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl"/>
</owl:Ontology>
...
<owl:Class rdf:ID="Table">
<owl:disjointWith>
<owl:Class rdf:ID="Chair"/>
</owl:disjointWith>
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Resource">
<rdf:first>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:ID="has_coarseArea"/>
</owl:onProperty>
<owl:someValuesFrom>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<owl:Class rdf:about="#MMAround09"/>
<owl:Class rdf:about="#MMAround1"/>
<owl:Class rdf:about="#MMAround12"/>
<owl:Class rdf:about="#MMAround15"/>
<owl:Class rdf:about="#MMAround2"/>
</owl:unionOf>
</owl:Class>
</owl:someValuesFrom>
</owl:Restriction>
</rdf:first>
<rdf:rest rdf:parseType="Resource">
<rdf:first>
<owl:Restriction>
<owl:someValuesFrom>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<owl:Class rdf:about="#MMAround07"/>
<owl:Class rdf:about="#MMAround08"/>
</owl:unionOf>
</owl:Class>
</owl:someValuesFrom>
<owl:onProperty>
<owl:ObjectProperty rdf:ID="has_coarseCentroidHeight"/>
</owl:onProperty>
</owl:Restriction>
</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first>
<owl:Restriction>
<owl:someValuesFrom>
<owl:Class rdf:about="#Horizontal"/>
</owl:someValuesFrom>
<owl:onProperty>
<owl:ObjectProperty rdf:about="#has_orientation"/>
</owl:onProperty>
</owl:Restriction>
</rdf:first>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
</rdf:List>
</rdf:rest>
</rdf:rest>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:subClassOf>
<owl:Class rdf:ID="Furniture"/>
</rdfs:subClassOf>
</owl:Class>
If I've understood well, these conditions are interpreted as restrictions, and managed as a super-class of the Table class.
So, if I load my ontology and the class Table with Jena:
1. String NS = "http://www.owl-ontologies.com/Ontology1317586695.owl#";
2. OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
3. model.read(OWL_FILE_NAME);
4. OntClass Table = model.getOntClass( NS + "Table" );
The NS variable has a correct value since the Table OntClass is loaded correctly. Then, while executing the following code, the line the line 10 should be reached, but it's not:
5. for (Iterator<OntClass> supers = Table.listSuperClasses(true); supers.hasNext(); ) {
6. OntClass superClass = supers.next();
7.
8. if (superClass.isRestriction())
9. {
10. System.out.println("Restriction found");
11. }
12. }
I've tried with Table.listEquivalentClasses() as well without success.
Any idea about what I'm loosing in the way?
UPDATE
Testing the code nicely implemented by Ian and shared here: https://gist.github.com/4065533, it works fine. But changing
OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF );
by
OntModel m = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
it stops working. It seems that Pellet doesn't recognize the restrictions as super-clases of the class.
The most common cause of such problems is that the URI's don't match exactly. If you had included a fragment of your actual data, as Turtle or RDF XML, and if you had stated what the value of NS was, that could be ruled in or out definitively.
Generally speaking, posting a screengrab of the user interface of your editing tool is not nearly as useful to people who want to help you as posting the source itself.
Update
Well, it works for me. I've put my (hint: runnable) code in a gist https://gist.github.com/4065533. The only differences I can spot between my code and yours are the OWL_FILE_NAME var (presumably you have checked that you are loading the right input source?), and the use of Pellet which I don't have available at the moment. You could check that the source of the problem is not Pellet by swapping to the Jena rule reasoner, but I strongly doubt that Pellet will be a factor.
Please try my gist code and see if that helps illuminate the problem. If you still can't get your code working, please post a runnable minimal test case. It should be runnable without having to guess or fill-in any missing information.
Related
I would like to infer an anonymous class definition for my Individuals in Protege.
I have a simple Ontology with the Classes Rain NoRain and Scene, The object Property has_weather.
My desire is to be able to infer "has_weather(?x, ?noRain), NoRain(?noRain), Scene(?x) -> (has_weather exactly 0 Rain)(?x) which i wrote in the Rules tab, where i can mix SWRL and OWL Expressions.
I am using Pellet Reasoner, however I also tried with OnTop and Hermit and none works. For example if I do the rule the other way around:
`has_weather(?x, ?noRain), (has_weather exactly 0 Rain)(?x), Scene(?x) -> Test(?x)`
It works without problems.
Is the problem, that Protege just can't infer anonymous classes? Is there any workaround? Thank you in Advance!
here is the code to the ontology
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#has_weather -->
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#has_weather">
<rdfs:subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain -->
<owl:Class rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain">
<owl:disjointWith rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Rain"/>
</owl:Class>
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Rain -->
<owl:Class rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Rain"/>
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene -->
<owl:Class rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain">
<rdf:type rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene -->
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene">
<rdf:type rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene"/>
<has_weather rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain"/>
</owl:NamedIndividual>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Rules
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<rdf:Description rdf:about="urn:swrl:var#x">
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Variable"/>
</rdf:Description>
<rdf:Description rdf:about="urn:swrl:var#noRain">
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Variable"/>
</rdf:Description>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#Imp"/>
<swrl:body>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#IndividualPropertyAtom"/>
<swrl:propertyPredicate rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#has_weather"/>
<swrl:argument1 rdf:resource="urn:swrl:var#x"/>
<swrl:argument2 rdf:resource="urn:swrl:var#noRain"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#ClassAtom"/>
<swrl:classPredicate rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#NoRain"/>
<swrl:argument1 rdf:resource="urn:swrl:var#noRain"/>
</rdf:Description>
</rdf:first>
<rdf:rest>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#ClassAtom"/>
<swrl:classPredicate rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Scene"/>
<swrl:argument1 rdf:resource="urn:swrl:var#x"/>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
</rdf:Description>
</rdf:rest>
</rdf:Description>
</rdf:rest>
</rdf:Description>
</swrl:body>
<swrl:head>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#AtomList"/>
<rdf:first>
<rdf:Description>
<rdf:type rdf:resource="http://www.w3.org/2003/11/swrl#ClassAtom"/>
<swrl:classPredicate>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#has_weather"/>
<owl:qualifiedCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:qualifiedCardinality>
<owl:onClass rdf:resource="http://www.semanticweb.org/stefi/ontologies/2021/8/8/untitled-ontology-55#Rain"/>
</owl:Restriction>
</swrl:classPredicate>
<swrl:argument1 rdf:resource="urn:swrl:var#x"/>
</rdf:Description>
</rdf:first>
<rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
</rdf:Description>
</swrl:head>
</rdf:Description>
</rdf:RDF>
`
In general a set of axioms has an infinite amout of entailments. See for example this paper. For this reason reasoners restrict inferences to known classes (not anonymous classes). I suspect this holds true for rules as well.
I therefore suggest you add a class NoRain that you set equivalent to has_weather 0 Rain and change your SWRL rule to use the class NoRain.
This is my first post to stack overflow so I request for an encouraging reply :) (bonus reputations)
I am trying to use SWRL to do some calculations for me. To imitate the problem, I have created a small ontology using protege 4.3. It has only two classes Parent and Son. Instances include 1 parent (John) and three sons (son1, son2, son3). John is linked with 3 sons using "hasSon" object property. Age of each son is mentioned using "hasAge" data-type property (integers).
Question-1: I need to first check that how many instances are linked with a given Parent(John) using hasSon property. How this can be achieved in SWRL?
Question-2: After knowing the number of Sons then I have to add their ages to get the total age of all the Sons again using SWRL?
For me, this require a loop like addition (a=a+b) but I dont know how this will work in SWRL. I have attached the OWL code for you.
(Please note that in actual ontology the linked instances are not 3 but are varying and counting them is part of the problem)
Thanks in advance
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY parenttrial "http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#" >
]>
<rdf:RDF xmlns="http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#"
xml:base="http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:parenttrial="http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#hasSon -->
<owl:ObjectProperty rdf:about="&parenttrial;hasSon">
<rdfs:domain rdf:resource="&parenttrial;Parent"/>
<rdfs:range rdf:resource="&parenttrial;Son"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#hasAge -->
<owl:DatatypeProperty rdf:about="&parenttrial;hasAge"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#Parent -->
<owl:Class rdf:about="&parenttrial;Parent"/>
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#Son -->
<owl:Class rdf:about="&parenttrial;Son"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#JohnF -->
<owl:NamedIndividual rdf:about="&parenttrial;JohnF">
<rdf:type rdf:resource="&parenttrial;Parent"/>
<hasSon rdf:resource="&parenttrial;Son1"/>
<hasSon rdf:resource="&parenttrial;Son2"/>
<hasSon rdf:resource="&parenttrial;Son3"/>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#Son1 -->
<owl:NamedIndividual rdf:about="&parenttrial;Son1">
<rdf:type rdf:resource="&parenttrial;Son"/>
<hasAge rdf:datatype="&xsd;integer">3</hasAge>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#Son2 -->
<owl:NamedIndividual rdf:about="&parenttrial;Son2">
<rdf:type rdf:resource="&parenttrial;Son"/>
<hasAge rdf:datatype="&xsd;integer">4</hasAge>
</owl:NamedIndividual>
<!-- http://www.semanticweb.org/admin/ontologies/2015/7/parenttrial#Son3 -->
<owl:NamedIndividual rdf:about="&parenttrial;Son3">
<rdf:type rdf:resource="&parenttrial;Son"/>
<hasAge rdf:datatype="&xsd;integer">5</hasAge>
</owl:NamedIndividual>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
Answer 1: There is no way through SWRL to check how many instances are connected to a certain property through SWRL. You are better off writing a sparql query with COUNT for this. Alternatively you can use an ontology framework and use an Iteratorto figure out the counts.
Answer 2: There is no way to loop a SWRL rule, perform an operation and return a value. SWRL rules are meant to add extra information about relations and not act as a programming language.
Solution: You are far better off using a ontology framework like Apache Jena or Owl api and writing a program to handle this instead of relying on SWRL. SWRL supports monotonic inferences only and thus cannot be used to loop over data in an ontology. Trying to do so will cause the rule to get executed infinitely.
Instead write a bit of code to do this. Refer to owl api or Jena ontology api and sparql in order to learn more on how to use these technologies.
I'm working on a project which includes a file uploader, now after extensive research and experimentation the uploader is working. However, it makes me uneasy as I don't understand the part that got it working the way I wanted it to. In order to achieve my goal I had to add a binding element to the service and the client (n-tier application) I don't really understand the binding element to tell you the truth, but I really don't understand the parameters in this element. If anyone is able, please provide a source where I can read up on these specific elements and if possible, describe them yourself.
Here is the section of code:
<binding name="BasicHttpBinding_IFileUploadService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="8388608"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas
maxDepth="32" maxStringContentLength="8192"
maxArrayLength="8388608" maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
Found exactly what I was looking for after wording my google search appropriately
http://msdn.microsoft.com/en-us/library/System.ServiceModel.BasicHttpBinding_properties(v=vs.85).aspx
I'm working with JSF 2 and JBoss EL (jboss-el-2.0.0.GA.jar). I'm having trouble getting a custom converter to work in a situation where I want to explicitly declare the converter along side the component in my xhtml page. I know there are tons of examples of this on the web already, and I've reviewed a good deal of them (like this one) with no luck, which makes this problem especially frustrating. Also, I've implemented a custom converter using the forClass element of the FacesConverter annotation, and it works. I've done things the same way for the explicitly declared converter, except for using the forClass element. Instead, I'm using the value element or none at all.
I've tried (seemingly) all combinations of annotations: with and without the value element, using simple class name and fully qualified class name, uppercase first letter and lowercase first letter, and using the converter attribute and the <f:converter> tag. From what I've read, some of those things shouldn't make a difference one way or the other, but I tried them for lack of knowing what else to do. Eclipse keeps warning me that the "converter id is not registered." I run it anyway (because I've seen other situations where Eclipse gave an error, but there wasn't one in reality), but it throws a NullPointerException. Why is this not working? Here's one version of my code:
Converter class
#FacesConverter(value = "MyConverter")
#ManagedBean
#ApplicationScoped
public class MyConverter implements Converter {
...
}
XHTML page
<h:selectOneRadio value="#{myBean.myProperty}"
layout="pageDirection"
required="true"
requiredMessage="#{myBean.requiredMessage}"
converter="MyConverter"
id="#{myBean.myPropertyId}" >
<!-- OTHER THINGS I'VE TRIED -->
<!-- <f:converter converterId="MyConverter" /> -->
<!-- <f:converter converterId="myConverter" /> -->
<!-- <f:converter converterId="myPackage.MyConverter" /> -->
<f:selectItems value="#{myBean.myPropertyOptions}" />
</h:selectOneRadio>
One thing I'm unsure about, and I'm not sure whether it makes a difference for my issue, is whether I should or should not add #ManagedBean and #ApplicationScoped to these converters. I've seen other questions about this on SO, but I still don't have a clear vision of what is absolutely necessary, what is good practice, and what shouldn't be done. This particular converter is stateless, so I'm not trying to determine which scope to use, but rather whether to decalare one at all (same for declaring #ManagedBean). I've also tried removing one or both of these annotations, but it didn't fix it. At this point, I feel like I'm just stabbing in the dark.
EDIT
In case it helps, here's the stack trace after trying to run it:
javax.faces.FacesException: java.lang.NullPointerException
at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NullPointerException
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.renderGroupOrItemRadio(HtmlRadioRendererBase.java:213)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:118)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:543)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:315)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:150)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:519)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:618)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1159)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
... 13 more
I need to convert my RDF graph document into OWL (1 or 2) recognized by Protege 3.x. There is a W3C Recommendation for mapping OWL 2 Web Ontology Language Mapping to RDF Graphs which says that to declare Object Properties from RDF graphs one should add the rdf:type owl:ObjectProperty element. I have found problems for expressing OWL object properties with RDF graph formalisms in the following code:
<rdf:Property rdf:about="&uni;isTaughtBy">
<rdf:type rdf:resource="&owl;ObjectProperty"/>
<rdfs:domain rdf:resource="&uni;Course"/>
<rdfs:range rdf:resource="&uni;Proffessor"/>
</rdf:Property>
With the following specified namespaces:
xmlns:uni="http://www.mydomain.org/uni-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
Unfortunately, the upper mentioned code is not recognized and thus shown in the Protege 3.x IDE.
The following code is readable by Protege 4 (recommended version). Copy paste the block and save it in a new file, you should then be able to read it with Protege:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY uni-ns "http://www.mydomain.org/uni-ns#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.mydomain.org/uni-ns#"
xml:base="http://www.mydomain.org/uni-ns"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:uni-ns="http://www.mydomain.org/uni-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://www.mydomain.org/uni-ns#"/>
<owl:ObjectProperty rdf:about="&uni-ns;isTaughtBy">
<rdfs:domain rdf:resource="&uni-ns;Course"/>
<rdfs:range rdf:resource="&uni-ns;Professor"/>
</owl:ObjectProperty>
<owl:Class rdf:about="&uni-ns;Course"/>
<owl:Class rdf:about="&uni-ns;Professor">
<rdfs:subClassOf rdf:resource="&owl;Thing"/>
</owl:Class>
</rdf:RDF>