• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to create my own RDF model in java ?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-1


I have an RDF model that has :

1. the following Classes :
-Person.
-Woman(subclass of person).
-Man(subclass of person).
-Child(subclass of person).
-Son(subclass of child).
-Daughter(subclass of child).

2. the object properties are :
-isMarriedto(domain:person/range:person).
-isSonOf(domain:person/range:person).
-isDaughterOf(domain:person/range:person) .

3. the data type properties are:
-Name(domain:person/range:string).
-Age(domain:person/range:int).

I want to create this model in java and reuse it to generate an RDF file.
Anyone can help me please or give me an example  ?
 
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't really suited to Java. For example a Son could also be a Man, and in Java an object can only be assigned to one type.
 
Yamna Ghazi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create this model in java :
 
Paul Clapham
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I just have this bias against designs which conflict with reality. Anyway, it should be extremely easy to create the Java classes described by your original post. So why don't you give that a try and let us know what problems you run into?

As for generating RDF from a collection of those objects, that's a separate problem. In fact Apache has built a whole package to do that sort of thing -- you might want to start by looking that up to get some ideas.
 
Saloon Keeper
Posts: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be the Apache Jena library. I wrote some sample code with that years ago. I'll try to find it tomorrow, maybe it'll help you.
 
Marshal
Posts: 69495
277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:. . . a Son could also be a Man . . .

It also worries me that they have separate Person and Child classes. Does a Child object cease to be a Child object after 18 years?
 
Paul Clapham
Marshal
Posts: 25594
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was expecting that this would be a practice exercise, and not the basis for any real-life system.
 
Tim Moores
Saloon Keeper
Posts: 6454
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found it. Based on file dates, it seems I worked on this in 2010. Can't believe it's been 10 years since then. My dabbling was based on https://www.wiley.com/en-us/Semantic+Web+Programming-p-9780470418017. The web site has example code for the book; check out the "HelloSemanticWeb" example in chapter 2. That got me started. I'm attaching the source code for that example.
Filename: HelloSemanticWeb.zip
File size: 10 megabytes
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic