Design an OWL DL ontology using Protoge - sparql

I have to design an OWL DL ontology using protoge which models the domain described with natural
language statements given below. Use class axioms and relations to other properties, e.g.
rdfs:subClassOf, owl:inverseOf and etc.
Museum is a Building.
Building consists of one or more Rooms.
Room can have different room types, such as Museum Room, Conference Room, Hotel Room.
Room is composed of Building Elements and Building Materials.
Historical Exhibition is an individual of a Museum Room.
Door, Window and Wall are Building Elements and compose a Room.
Door is externally connected to some Wall or Window.
The material type of a Window is one of Building Materials: Aluminum, Steel, Wood
or Plastic.
However, I do not know how to do this. I tried but I have no clue if I am doing it right/ what I have to do different.
I added Building (with subclass Room whereby room has ubclasses Conference_Room, Hotel_Room, Museum_room), Building_elements (with subclasses Door, Wall, Window) , Building_material (with subclasses Aluminum, Plastic, Steel, Wood), Museum as classes
Next to that, I added Object properties:
Compose_a --> domains : Building_Elemens and Ranges : Rooms
Composed_of --> domains: Rooms, Ranges : Building_material, building_elements
Consists_of --> domains: Building, Ranges: Rooms
externally_connected_to --> domains = Door, Ranges : Wall, Window
is_and_individual --> domains = Historical_exhibition, Ranges = Musem_Room
What am I doing wrong? I don't get a picture when I want to visualize in with OWLviz.
Thanks in Advance!
Picture 1
Picture 2

Related

Ebay API - How To Determine Shipping Locations From FindItemsByCategory?

I'm retrieving all used buy-it-now camera and lenses from
EBAY-AT, EBAY-CH, EBAY-DE, EBAY-ES, EBAY-FR, EBAY-FRBE, EBAY-GB, EBAY-IE, EBAY-IT, EBAY-NL, EBAY-NLBE, EBAY-PL and EBAY-US
My 'customers' will come from all over Europe and the United States
I want to show them products which offer delivery to their country regardless of which EBAY site it originates.
https://developer.ebay.com/DevZone/finding/CallRef/findItemsByCategory.html#findItemsByCategory
shipToLocations - An international location or region to which the seller is willing to ship the item. Only returned when the seller has specifically identified locations where she is willing to ship the given item. specified.
https://developer.ebay.com/DevZone/finding/CallRef/Enums/shipToLocationList.html
This lists the possible values for the shipToLocation
However the API calls all come back with 'Worldwide' for shipToLocation, however this is just not true as I checked some which say are ship to just UK, Europe or even collection only.
What other options are there?

Has anyone gotten Kimono meta APIs to combine results from multiple APIs?

The documentation describes a meta collection as a combination of 2 (or more) different APIs...
By default, a meta API endpoint returns all data from all of its
sub-APIs, organized by collection.
But, what I find is that it does not do this. It grabs partial data from some sub-APIs and fails silently, without logging an error.
API #1 Result
COLLECTION2
ROW LIST.HREF LIST.TEXT INDEX URL
1 http:/​/​www.amazon.com/​Org...pollux+​organix+​canned+​dog Canned Dog Food 3 http:/​/​www.austinpetsalive.org/​donate/​wish-​list/​
2 http:/​/​www.amazon.com/​Pre...s-​Large/​lm/​R34ISSXSRJPA71 Premier Brand Martingale collars (Pink, Silver, Blue, Red, and Orange) sizes XL or L 4 http:/​/​www.austinpetsalive.org/​donate/​wish-​list/​
3 http:/​/​www.amazon.com/​Pre...ords=​medium+​gentle+​leader Medium & Large Gentle Leaders 5 http:/​/​www.austinpetsalive.org/​donate/​wish-​list/​
API #2 Result
COLLECTION2
ROW LIST.HREF LIST.TEXT INDEX URL
1 Dry kitten and adult dog food (we ask that the first ingredient listed on the bag be meat). Some Brands we love include: Purina One, Pro-Plan, Wellness, Evolve, Blue Buffalo, and Kirklands 9 http:/​/​pawsshelter.org/​donate/​wishlist/​
2 Cat Litter 10 http:/​/​pawsshelter.org/​donate/​wishlist/​
3 Kongs, Balls, Durable Toys, Puzzle Toys 11 http:/​/​pawsshelter.org/​donate/​wishlist/​
Meta API Result Collection 2 -- it's the entire data set from API #2 and none from API #1
COLLECTION2
ROW LIST.HREF LIST.TEXT INDEX URL API
1 Dry kitten and adult dog food (we ask that the first ingredient listed on the bag be meat). Some Brands we love include: Purina One, Pro-Plan, Wellness, Evolve, Blue Buffalo, and Kirklands 132 http:/​/​pawsshelter.org/​donate/​wishlist/​ PAWS Shelter and Humane Society
2 Cat Litter 133 http:/​/​pawsshelter.org/​donate/​wishlist/​ PAWS Shelter and Humane Society
3 Kongs, Balls, Durable Toys, Puzzle Toys 134 http:/​/​pawsshelter.org/​donate/​wishlist/​ PAWS Shelter and Humane Society
The data structure is verbatim the same. Why don't they combine under meta API?
Testing
A meta API combination worked with 2 APIs, each with one collection.
When there is more than one collection defined, certain combinations of APIS combined partially. Each collection filled with the contents of one or the other API, but never both.
The 3 APIs I need to combine result in one site's results in all of the collections, and nothing from the other two in any collection, and no error logged.
The flaky results seem tied to the collections. But I've moved on to a klugey temp fix, which is to call each API separately and combine the JSON results in my app. 3 API calls instead of one. Might be looking for another tool, soon.
Now it works
Since I posted this question in October, KimonoLabs has updated their app and I am now having consistent success with creating and using a Meta API for the set of single APIs I posted above.
That's the positive.
The catch is that you cannot use the URL parameters in a meta API, so if you'd written post-process modify results functions, they will not be executed, even if you use kimmodify=1.

Create and connect individuals with an OWL DL reasoner

I have an ontology with different type of events.
Therefore I have three classes: A, B, C and a helper class Temp.
I want the reasoner to create a new individual as a subclass of C for every pair of individuals a (rdf:typeOf A) and b (rdf:typeOf B) found. This new Individuals should contain informations about a and b.
In the past I used a jena reasoner with an own rule file to get this result, but now I want to switch over to a standard OWL DL reasoner.
My initial idea is to link a und b such as:
a onto:hasB b
And ad give a the Type Temp with the following restriction for Temp:
hasbB some B
Now I want to create a new individual of type C with a restriction for Temp:
hasC some C
And over this new indivual I can access the informations of a and b.
My Problems are:
How can I get the reasoner to connect a and b?
I don't think the creation of C will work, since its a restriction for Temp, which will never be assigned as a type because of this restriction.
Or am I completly wrong with my approach?
Edit:
To clarify my goal with a better exmple:
I have an ontology with different type of events.
My goal is to connect certain individuals (events) which belong together by forming a new individual (event) describing this relation with the help of a reasoner.
E.g.:
I read an event (individual) which describes an "Alarm" (type) into the ontology.
I read an event (individual) which discribes a "PowerOutage" (type) into the ontology.
These Individuals aren't related at all at this moment.
Now I want a reasoner to create a new event (individual) with the type "PowerManipulation". In fact I want an individual with the type "PowerManipulation" created for every pair (which isn't connected, yet) of individuals with the type "PowerOutage" and "Alarm" found. These new individuals should have references (properties) to the individual which caused their creation (an "Alarm" and a "PowerOutage").
Ontology before the reasoning:
(alarm1 rdf:type "Alarm")
(out1 rdf:type "PowerOutage")
What I want the ontology to look like after the reasoning
(alarm1 rdf:type "Alarm")
(out1 rdf:type "PowerOutage")
(man1 rdf:type "PowerManipulation")
(man1 ont:hasRealtadInd alarm1)
(man1 ont:hasRealtedInd out1)
Priviously I used Jena rules and the Jena reasoner to accomplish this task.
But I want to switch over to a standard OWL DL reasoner.
Is it possible to accomplish this task with basic restrictions?
Or do I need SWRL rules, or SPIN (see Williams answer below)?
You can do this with SPIN constructors quite easily and SPIN inserts.
http://www.w3.org/Submission/2011/SUBM-spin-modeling-20110222/#spin-rules-construct
http://www.w3.org/Submission/2011/SUBM-spin-modeling-20110222/#spin-rules-update
SPIN and OWL can live happily together. Take a look at the groovy library that has extensions for both:
https://github.com/williamgreenly/lescot
Example below:
def model = new GroovyRdfModel()
model.add(""" some turtle data """)
model.add(""" some OWL rules """)
model.add(""" some SPIN rules """)
def inferredModelByOWLReasoning = model.owl()
def inferredModelBySPINRules = model.spin()

Designing a rest url - filter with multiple params over entities (not last entity)

Let's say I have the following entities in my libraries app - Library Room, shelf, Book.
Where Room has N shelves, and shelves have N Books.
Now the following url brings me a list of books whose
library is 3, room no. is 5 and shelf no. is 43.
.../library/3/room/5/shelf/43/books
Assuming shelf 43 is unique per room only
(There is shelf 43 also in other rooms)
and Rooms are not unique (There's a few room no. 5 ) in the library.
Here is my questions:
I want to filter with more fields on the entities, here is what i want to do
(representation not in rest):
.../library/id=3&type=3/room/decade=21&topic=horror/shelf/location=east&/books
This is not rest.
How do I represent it in rest?
Notes:
I don't want to do this way
.../books&param1=X&param2=X&param3=X&param4=X
because not all params are related to books.
Couple of things that you need to look into while designing your apis.
1) are type, decade, topic etc required fields? if so, I will probably make them a part of the path itself, such as:
../libraries/{libraryId}/type/{typeId}/rooms/{roomId}/decades/{decadeId}/topics/{topicName}/shelves/{shelfId}/locations/{shelfLocation}/books
Here I am assuming that each library can have rooms which have unique room ids per library, each room can have shelves which has unique ids/locations per room (and so on and so forth). Yes, the url is pretty long, but that's kind of expected
2) if these fields are not required, you could use a different approach which is a bit less verbose but a bit more confusing for client developers who have never used such approach here. Here's a straight up example Restful Java with JAX-RS by Bill Burke
#Path("{first}-{last}")
#GET
#Produces("application/xml")
public StreamingOutput getCustomer(#PathParam("first") String firstName,
#PathParam("last") String lastName) {
...
}
Here, we have the URI path parameters {first} and {last}. If our HTTP request is
GET /customers/bill-burke, bill will be injected into the firstName parameter and
burke will be injected into the lastName parameter.
If we follow this somewhat academic approach (I have not seen this implemented on many platforms. Most platforms normally go with approach # 1, a more verbose but clear approach), your URL would look somewhat like this:
../libraries/{libraryId}-{typeId}/rooms/{roomId}-{decadeId}-{topicName}/shelves/{shelfId}-{shelfLocation}/books
This way, if the client developer doesn't pass in the non-required fields, you can handle it at the business logic level and assign these variables a default value, for example:
../libraries/3-/rooms/2-1-horror/shelves/1-/books
With this url, libraryId = 3, typeId = null (thus can be defaulted to it's default value) and so on and so forth. Remember that if libraryId is required field, then you might want to actually make it a part of the pathparam itself
Hope this helps!

ESPN API - How can I retrieve college basketball conferences using the Teams API?

The support forums on ESPN.com recommend using Stack Overflow with the ESPN tag. That's why I'm here.
I'm trying to obtain a list of all NCAA college basketball teams using ESPN's Teams API. I started with this GET request:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams?apikey=MY_API_KEY
That gave me a list of teams, but many of them are missing. For example, there is no Nebraska. So then I thought that maybe I need to get a list of teams by conference. So I read this in the documentation:
GROUPS: Allows for filtering by "group" or division, e.g. AL East, NFC South, etc. For group IDs and their corresponding values, make a request to http://developer.espn.com/v1/{resource}/leagues. Not applicable to golf and tennis.
So then I try to make a request to `http://developer.espn.com/v1/sports/basketball/mens-college-basketball/leagues?apikey=MY_API_KEY' and it says the page does not exist.
Is this a bug or user error?
First, I think you forgot sports in the resource. Try this:
http://api.espn.com/v1/sports/basketball/mens-college-basketball?apikey=MY_API_KEY&leagues
That will return a mapping of integers to conferences it seems according to the documentation.
That fetched me:
{"name" :"Atlantic Coast Conference","abbreviation" :"acc","groupId" :2,"shortName" :"ACC"}
...and much more.
Then once you have that, let's say 2 = ACC. You should be able to do this:
http://api.espn.com/v1/sports/basketball/mens-college-basketball?groups=2&apikey=MY_API_KEY'
to get everything on ACC mens' basketball teams.
Bear in mind the API is in beta though.
I could not figure out how to get a list of conferences, but I found out how to get the missing teams. When I was making the first get request, it was limiting me to 50 results by default:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams?apikey=MY_API_KEY
They have a sandbox where you can play with your parameters, and I saw a limit and offset option:
http://developer.espn.com/io-docs
To get more than 50 results, you have to make multiple requests using the limit and offset parameters.
First Call:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams/?limit=50&offset=0&_accept=text%2Fxml&apikey=MY_API_KEY
Next Call:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams/?limit=50&offset=50&_accept=text%2Fxml&apikey=MY_API_KEY
And so on...