issues with min one in Protege - owl

I have a homework to do for my studies that requires to use Protégé.
I am pretty new with the language OWL and with this software.
We need to create an ontology on hiking trails.
I have multiple classes like Hikers, Trails, Restaurants, Hotels, Equipements, and Places.
This last class (Places) has 2 subclasses: StartEndPoint and PicnicArea.
The class StartEndPoint correspond to the places where a trails start and end. So for my Trails class I have the axiome: (startingPoint exactly 1 Places) and (endingPoint exactly 1 Places) to symbolise that a trail starts and end at exactly one starting and ending point.
Similarly, i would like to create the axiom: each starting and ending place has at least one restaurant near this point.
To do so, i have added the axiom: "eatingPlace min 1 Restaurants" in the class StartEndPoint.
But when I run the reasoner, it says no error. I did create some instances from all classes but for the instances from the class StartEndPoint, it should say that there is no restaurant as I didn't add any property "eatingPlace" to those instances (see screenshots below).
I wanted to try if the minimum one were working well and so it should have returned me an error i guess. But I got nothing.
Is it normal ? If yes why ?
And if no, how could I resolve this ?
thanks a lot for your help

The reasoner is not finding any errors because of the Open World Assumption. You are stating that each endpoint has at least one restaurant near it, but this does not place any obligation on the ontology to list which restaurant is near to your endpoints - i.e., if you ask the reasoner if there is a restaurant near endpoint X, the reasoner will say yes; but, if you ask it to list the restaurants near endpoint X, the list might be empty because the information is not included in the ontology. This is expected behaviour for OWL ontologies.

Related

ADNStoreFront Multistore AddtoCartForm function crashing page

I am trying to modify an existing XML package of Aspdotnetstorefront Multistore. It's an internal XML package to show the variants of a certain product. What I did to start with was to copy-paste the whole code as is and throw it into a new custom XML package. The problem is that it works fine in the original package but not in the copied package. When I try to run it the function "AddtoCartForm" crashes the page and show the following error while display in red the line that contains the function call:
An HtmlHelper is required for this method. Make sure to specify one when you call the RunXmlPackage method
The format of the function is:
<xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1, 1, $SelectedSize, $SelectedColor)" disable-output-escaping="yes"/>
I removed the line with the function just to be sure and then everything else works fine. I have no idea what's wrong here. Everything is identical unless by the structure of the url which calls the package:
For the internal package it is: \product\123456
For the custom package it is: \topic\packagename?ProductID=123456
I checked the XML produced by the SPs, the runtime and requested data and it's basically the same in both cases. The ProductID and VariantID values are there. SelectedColor and SelectedSize are not in the XML (not even in the internal package) so it may be just providing null value and probably it's not necessary anyway.
And there is more. If I supress the productid value from the url like this:
\topic\packagename
It won't crash the page (but also won't render because there will be not be any value to process).
In any way I cannot see why it wouldn't work just passing the variable in the querystring (that is basically what it does in the original package even in a different format) and the var value (productid) it getting there. However it seems that it is indeed the url format that is not pleasing the package but it doesn't make too much sense to me. I am over this for several days already and nothing I do seem to produce any positive result. :-(
I looked up online for some documentation but didn't get lucky and didn't find absolutely anything. In extreme cases I try to reach the Vortx support (and they usually answers me giving some valueable clue) but this time it seems that for this specific issue there will not be any help unless I pay an obscene hour fee and unfortunately it's out of question... LoL!
Any idea?
UPDATE: We don't use Multistore regular search tool. Due to the nature of our products (recycled car parts) we have a custom search tool that will try to find 'similar' items that MAY fit the user needs when we don't have the EXACT part. I don't know if you are ware of but several mechanical car parts are interchangeable among different models and makes (like alternators, AC compressors, battery, suspension, cooling system, etc), so when one of our customers needs a part to fix his car he won't tell us the part code; instead he will tell us the car model, year, and generic name of the part so we will try to find the part for him. It does mean that a certain Corolla part will fit perfectly in a Honda Accord and so on. Some times we have some parts in stock that MAY fit his car but we are not absolutely sure. When it happens we will show those parts for the customer and he will decide if he can take his chances. For the sake of customer comfort we want to show all these parts in the same page, but since they normally are variants of different products we cannot use the regular product page for this purpose (because the product page will only show variants of ONE product at time). For this reason I am going to write a package - a modified version of the product page - that will do that but I am struggling with the AddtoCartForm function. In fact I JUST found a workaround by adding the item to the cart accessing directly the /shoppingcart/addtocart script and now my problem is being to force it return to a specific url after to add the item to the shopping cart...
The error has to do with the topic token able to properly get html helper filled out.
I do question why testing is being done on a topic. To test a new product xmlpackage I normally change change the xmlpackage for just one product in a testing environment.
If chaning the product xmlpackage isn't possible then I suggest using the XmlPackageController/engine instead. Which is documented on page https://help.aspdotnetstorefront.com/1000/xml_packages.htm under the heading of "Invoking XML Packages by Themselves". If using the XmlPackageController make certain that the allowengine attribute is set to true in the xmlpackage otherwise that will throw an error as well.

How to import specific classes and object properties from an ontology in Protege?

I want to import some classes in Protege from different ontologies to my ontology. For example, I need the classes foaf:Person, org:Site, vcard:Organization, and many more.
I don't want to create them by myself (and modifying their IRI). When I did import the whole ontology (Schema.org, vCard, FOAF, …), I had many elements that I don't need.
Is there any way to do it?
— Have you looked at this thread: protege-project.136.n4.nabble.com/…
— I tried to use it, but it didn't work.
There are subtle moments, especially on step 5.
Open your target ontology.
Open the source ontology in the same window.
Select Refactor > Copy/move/delete axioms:
Select axiom selection method.
Select signature (i. e. a set set of classes, properties etc.) to import. Do not forget to press >> !
Now you can preview axioms to be imported.
Select what you want to do:
8-9. Select your target ontology:
Voila!

Grails 3 "show" view with Fields plugin 2.1.0-SNAPSHOT

Stuck at a trivial problem in Grails 3.1.5: Show the fields of a domain object, excluding one of them, including a transient property. Yes, this is my first Grails 3 project after many years with previous versions.
The generated show.gsp contains
<f:display bean="rfaPdffile"/>
This will include a field that may contain megabytes of XML. It should never be shown interactively. The display: false constraint is no longer in the docs, and seems to be silenty ignored.
Next I tried explicitly naming the fields:
<f:with bean="rfaPdffile">
<f:display property='fileName'/>
<f:display property='pageCount'/>
...
</f:with>
This version suprisingly displays the values without any markup whatsoever. Changing display to field,
<f:with bean="rfaPdffile">
<f:field property='fileName'/>
<f:field property='pageCount'/>
...
</f:with>
sort of works, but shows editable values. So does f:all.
In addition I tried adding other attributes to f:display: properties (like in f:table), except (like in f:all). I note in passing that those two attributes have different syntax for similar purposes.
In the Field plugin docs my use case is explicitly mentioned as a design goal. I must have missed something obvious.
My aim is to quickly throw together a prototype gui, postponing the details until later. Clues are greatly appreciated
If I understood you correctly, you want to have all bean properties included in the gsp but the one with the "megabytes of XML" should not be displayed to the user?
If that is the case you can do:
f:with bean="beanName"
f:field property="firstPropertyName"
f:field property="secondPropertyName"
And the one you don't wish to display:
g:hiddenField name="propertyName" value="${beanName.propertyName?}"
f:with
So list all the properties as f:field or f:display and put the one you don't wish to display in a g:hiddenField Grails tag
You can also try:
f:field property="propertyName"
widget-hidden="true"
but the Label is not hidden in this case.
Hope it helps
My own answer: "use the force, read the source". The f:display tag has two rather obvious bugs. I will submit a pull request as soon as I can.
Bugs aside, the documentation does not mention that the plugin may pick up the "scaffold" static property from the domain, if it has one. Its value should be a map. Its "exclude" key may define a list of property names (List of String) to be excluded. This probably works already for the "f:all" tag; bug correction is needed for the "f:display" tag.
My subjective impression is that the fields plugin is in a tight spot. It is intertwined with the Grails architecture, making it sensitive to changes in Grails internals. It is also required by the standard scaffolding plugin, making it very visible. Thus it needs constant attention from maintainers, a position not to be envied. Even now conventions for default constraints seem to have changed somewhere between Grails 3.0.9 and 3.1.7.
Performance of the fields plugin is sensitive to the total number of plugins in the app where it is used. It searches all plugins dynamically for templates.
For the wish list I would prefer stricter tag naming. The main tags should be verbs. There are two main actions, show and edit. For each action there are two main variants, single bean or multiple beans.
My answer is that at present (2 March 2017) there is no answer. I have searched the Net high and low. For the index (list) and create and edit views, the fields plugin works well enough. A certain field can be easily excluded from the create and edit views, relatively easily from the list view (by listing those that should show), and in no way I could find from the show view. This is such a common need that one would suspect it will be addressed soon. Also, easily showing derived values in the show view, like 'total' for an invoice. One can do that by adding an ordered list with a list item showing the value below the generated ordered list of values, but that is kind of a hack.
In some ways, the old way was easier. Yes, it generated long views, but they were generated and didn't have to be done by the programmer - just custom touches here and there.

Loading different files using OWL API

I am using OWL API to load different files and merge into one for reasoning. I have one file describing the ontology and several files with individuals. Every individual has foaf properties, e.g., foaf:title, when I print the axioms it shows
'AnnotationAssertion(http://xmlns.com/foaf/0.1/title...'
and reasoning does not work. If I add
<'owl:DatatypeProperty rdf:about="http://xmlns.com/foaf/0.1/title'/>
into the individual file than title loads as
'DataPropertyAssertion(http://xmlns.com/foaf/0.1/title...' and reasoning works.
In the FOAF ontology is says that it is a data property, but loading it did not work either. I am using OWLOntologyMerger to merge the ontologies.
And I cannot add that into every file. Is there a way to do it programmatically or any way?
Thanks.
Use owl:imports from each file to import the base ontology, or foaf.
The problem here is that the owl api needs the declaration to be available either in the file or in the imported ontologies. It is not possible to parse rdf/XML unambiguously otherwise.

owl:imports in Fuseki

I'm new here, and although I've searched for something like this, I couldn't find an answer. So here is my question: How Fuseki handles owl:imports?
Details: I've defined a set of ontologies in different owl files. Let's call two of them of subDomainA.owl and subDomainB.owl.
To "join" these ontologies, I've defined a single owl file that imports the others. Let's call it completeDomain.owl, which owl:imports subDomainA.owl and subDomainB.owl. There are a few statements explicitly declared in completeDomain.owl. If it's not clear, It's something like sweetAll.owl in SWEET.
I need to import these owl files (with RDF/XML syntax) into TDB using Fuseki. How these imports will be handled? I mean, should I load the completeDomain.owl to the default graph and subDomainA.owl and subDomainB.owl to their respective graphs and Fuseki would "understand" imports and let me query all of them at once?
Using tdb:unionDefaultGraph is the same thing? What would happen with the statements declared in completeDomain.owl that uses entities declared in the subDomain ontologies? Also, I couldn't see the difference of tdb:unionDefaultGraph and Union Model.
As you can see, I'm a little bit confused and any help will be appreciated!
Following the tips from Joshua bellow(thanks for them, by the way), here is the answer:
To organize owl:imports into Fuseki, there are 3 options:
1) Import all ontologies files to the default graph.
2) Configure the store using tdb:unionDefaultGraph with true value, and import each file to its own named graph. This way, Fuseki will answer a query to the default graph with the union of all named graphs. Also, each graph can be acessed by its named graph and/or SPARQL GRAPH.
3) A Union Model combines in a single graph other graphs. Any app would not be able to query the graphs separatedely.
The original answer to this question is here!

Resources