-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: how to convert a RDF TTL to a POJO? #4
Comments
That is a rather broad question. However, I will make some assumptions.
The way this library works is you read the TTL into a Jena Model. You can consider this a graph with nodes connected by arcs. It should not be confused with the Jena Graph object. I will refer to the deserialised TTL file as a graph, but remember that it is a Jena Model. In the graph there are nodes that correspond to the subject nodes in your TTL. In fact they have the same URI. You create a Java interface with methods to get/set the properties on the the subject nodes. You annotate the interface with the Setters come in 2 types Let's call your interface MyInterface. Once you have completed MyInterface you do the following.
It has been awhile since I used this code, I did start to update it for the new Jena releases, but did not complete it. It should be fairly easy to finish. I will work on it if you want to use the library. |
First of all, thanks for the detailed reply. I'll need to read it several more times to see I understood correctly your explanation. |
I'm attaching a minor example of TTL file code. In realty, it's much much more larger.
|
You need to create an interface something like
And then you load the model and execute
|
Hi @Claudenw, I'm not sure why, but the all (Host & Account) POJOs params seems to be Pa4rdf.java
Host.java
Account.java
|
the problem may be
change it to
If that doesn't work, you should probably set a property and then print out the graph. You should see the property attached to a resource. This should point you to a solution where you can find the property in the graph. |
Hi @Claudenw, |
BTW, I just realized that I won't have in my TTL files the metadata of the objects and their properties.
|
What version of the library are you using? |
You need to set the so
|
Great, this helped!
The problem is, inside the list, when I get an element from there (in my case it's When I Evaluate it during Debugging, I can see 2 things:
|
Hi @Claudenw, any thoughts regarding the list of objects? |
I have not had time to look, but I think that the docs say that it does not
support lists. However, I think I implemented it on one of the branches
awhile back.
…On Tue, Aug 31, 2021 at 10:08 AM BoraBak ***@***.***> wrote:
Hi @Claudenw <https://github.com/Claudenw>, any thoughts regarding the
list of objects?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASTVHWKAOGVDIRBI35GYWTT7SLYTANCNFSM5CZZ4TPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
|
OK, I understand. |
The simplest way to retrieve the list in the current implementation is for the method to return the Jena Resource and then use the |
I have a TTL file format which I want to convert/unmarshal to its relevant POJOs.
Does this capability exists?
The text was updated successfully, but these errors were encountered: