openRDF.org Welcome Guest   | Login   
  Search  
  Index  | Recent Threads  | Who's Online  | User List  | Search  | Help  | RSS feeds

Forum has been closed down
This forum has been closed down due to extensive spamming activities. Please use the mailing list instead.


Quick Go »
Thread Status: Normal
Total posts in this thread: 3
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 2923 times and has 2 replies Next Thread
Jun 6, 2008 10:57:35 PM

blownzone
Visitor


Hong Kong
Joined: Jun 6, 2008
Posts: 2
Status: Offline

JavaModel, live inferencing across Java objects?

Is this possible?, asks a friend of mine:

"JavaModel" is meant to represent/abstract Java objects directly via RDF. Statements, queries and inference results are determined by the live-running java virtual machine's program.


class JavaModel implements openrdf.Model {
public JavaModel(Object root) { ... }

public Object getObject(URI u) { .. }
public Object setObject(URI u, Object newValue) throws JavaModelException { .. }

...
}

Classes and methods are annotated:

@Class("ClassC1")
interface C1 {

@Property("isRelatedTo")
Resource getRelationR();

@Value("hasValueV")
Double getValueV();

}

?
Show Printable Version of Post        letstalk    privatemsg    letstalk [Link] Report threatening or abusive post: please login first  Go to top 
Jun 7, 2008 5:54:19 PM

james
OpenRDF.org Consultant
Member's Avatar

Canada
Joined: Jul 21, 2005
Posts: 650
Status: Offline
Re: JavaModel, live inferencing across Java objects?

Creating this JavaModule as a wrapper around a statically available RepositoryConnection would be straight forward.

However, you can also use the DynaBean interface w/ Elmo that would look something like this:
DynaBean person = (DynaBean) manager.find(new QName("urn:me"));
Set<DynaBean> friends = (Set<DynaBean>) person.get("http://xmlns.com/foaf/0.1/knowns");
person.set("http://xmlns.com/foaf/0.1/knowns", friends);


OpenRDF Elmo also supports using interfaces like this:
@rdf(NS + "ClassC1")
public interface C1 {

@rdf(NS + "isRelatedTo")
Object getRelationR();

@rdf(NS + "hasValueV")
Double getValueV();

}

----------------------------------------
Sesame Consultant
http://leighnet.ca
http://jamesrdf.blogspot.com
Show Printable Version of Post        Hidden to Guest    http://leighnet.ca [Link] Report threatening or abusive post: please login first  Go to top 
Jun 8, 2008 12:45:41 AM

blownzone
Visitor


Hong Kong
Joined: Jun 6, 2008
Posts: 2
Status: Offline

Re: JavaModel, live inferencing across Java objects?

thanks very much, i will examine DynaBean!
Show Printable Version of Post        letstalk    privatemsg    letstalk [Link] Report threatening or abusive post: please login first  Go to top 
[Show Printable Version of Thread]