Re: XDI-Zephyr methods implementation

6 views
Skip to first unread message

Markus Sabadello

unread,
Mar 1, 2013, 6:48:26 AM3/1/13
to Shrey Mehrotra, xd...@googlegroups.com
Hello Shrey,

I took a closer look at your work, and here are a few comments:

#1 As I mentioned earlier, the constructor of XDI3Segment (and of similar classes) has changed, due to the way parsing works in XDI2.
In fact, I now made it so that the constructor isn't visible at all.
Instead, you should call the following factory method:

XDI3Segment.create(string)

#2 Several files need updating to say "Zephyr" instead of "CloudFabric":
- WEB-INF/web.xml
- WEB-INF/applicationContext.xml
- README.md
- index.html

#3 I'm trying to use your code to talk to my own Zephyr instance in a VirtualBox, so I create an XDI graph as follows:

ZephyrGraphFactory graphFactory = new ZephyrGraphFactory();
graphFactory.setDataApi("http://172.16.0.197:10002/");
graphFactory.setOauthToken("SECRET");

However, your code always uses http://107.21.179.68:10002/ instead of the URL I configure in the GraphFactory. Same for the OAuth token.

#4 Maybe you could add some slf4j logging to your ZephyrUtils class, like all other parts of XDI2 use it.
This way we can see all your HTTP calls in the logs.
Please don't use System.out anywhere in your code.

#5 In the createContextNode() method, you're not making any call to the CloudStore, but you should create the context according to rule 2 in the Data Mapping.

#6 All the creatXXX methods should throw an Xdi2GraphException if the context node, relation or literal already exist in the XDI graph.

#7 Regarding createRelation(), you should implement

public Relation createRelation(XDI3Segment arcXri,ContextNode targetContextNode);

and not implement

public Relation createRelation(XDI3Segment arcXri, XDI3Segment targetContextNodeXri);

#8 Your getContextNodes() returns an iterator over Strings, but it should return an iterator over ContextNode objects.

----

That's it for now :) We'll probably discover more details as we move ahead.

For issues #1 and #2, I have created a pull request on your repo in Github, please accept it.

Markus

On Wed, Feb 27, 2013 at 4:48 PM, Shrey Mehrotra <shrey....@gmail.com> wrote:
Hi Markus,


I have just committed the implementation of some methods in my github repository. Could you please check if you are able to run and test those methods at your end by running Test.java for a new user(say =!3333).


would it be ok if I call you at 5:30 PM or 6:00 PM at your time? Let me know in case of any query/issue.

Thanks,
-Shrey




Shrey Mehrotra

unread,
Mar 1, 2013, 7:10:17 AM3/1/13
to Markus Sabadello, xd...@googlegroups.com
Thanks Markus for the detailed compilation, I know that the code needs refactoring at some points like the Zephyr URL and sysouts.In this first draft, I focused mainly on functionality.I will make the suggested changes and commit that soon..

-Shrey
Reply all
Reply to author
Forward
0 new messages