How to use Frames and Blueprints correctly with a SailGraph

162 views
Skip to first unread message

Thomas Fritz

unread,
Aug 5, 2011, 5:15:20 AM8/5/11
to Gremlin-users
Hello

I want to use a SailGraph Implementation (https://github.com/tinkerpop/
blueprints/wiki/Sail-Implementation) for storing RDF.
I am new to Blueprints so sorry for my ignorance.

Can someone give me an example of how to add something to the
SailGraph correctly so i can use Frames how it is intended to use.
This would be great. Maybe it could be added to Documentation too.
For my test case i try to map a Skos Concept with a narrower Concept.
Each Concept with a preferedLabel in English and German. Optional with
an altLabel and hiddenLabel.

I am not sure if i can use Frames as i thought i could. So an example
would be great.

Thanks in advance.
Kind regards

Thomas

Marko Rodriguez

unread,
Aug 5, 2011, 12:17:31 PM8/5/11
to gremli...@googlegroups.com
Hi,

There are limits to what you can do with SailGraph as SailGraph exposes and RDF graph as a PropertyGraph. Thus, when you try and make properties, if its not legal RDF, it will not allow you.


Thus, if you do want to use frames, your properties for a Literal vertex have to be lang,value,type,etc. In other words:

@Property("lang")
public void setLanguage(String language);

@Property("lang")
public String getLanguage();

HTH,
Marko.

Joshua Shinavier

unread,
Aug 5, 2011, 1:08:37 PM8/5/11
to gremli...@googlegroups.com
Hi Thomas,

Layering Frames on SailGraph is a neat idea. Like OpenRDF Elmo for
Blueprints. I have just checked in a Frames test case which explores
that idea and provides an example:

https://github.com/tinkerpop/frames/blob/master/src/test/java/com/tinkerpop/frames/SailFramesTest.java

Is that more or less what you had in mind?

Thanks.

Josh

Thomas Fritz

unread,
Aug 8, 2011, 8:23:30 AM8/8/11
to gremli...@googlegroups.com
Hi.
Thanks. Thats exactly what i had in mind.

It would be great if we could define a namespace with an annotation -
@Namespace("http://www.w3.org/2004/02/skos/core#") - so we then could
just add a @Relation(label="prefLabel") for instance.
Is it possible to use a class instead of an interface as frame model?
That would allow us to override the implementation of the methods. So
we could return a special Label object when calling getPrefLabel()?


Thank you so far

Kind regards

---
Thomas FRITZ
web http://fritzthomas.com
twitter http://twitter.com/thomasf

2011/8/5 Joshua Shinavier <jo...@fortytwo.net>:

Thomas Fritz

unread,
Aug 8, 2011, 8:46:04 AM8/8/11
to gremli...@googlegroups.com
Hi again

Actually the annotation for namespaces has to be something like this i think:
@Namespace({
"skos","http://www.w3.org/2004/02/skos/core#",
"rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
})

A more concrete use case example for such a skos frame model where a
concrete class would be better than an interface:

@Namespace({"skos","http://www.w3.org/2004/02/skos/core#", "rdf",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"})
private class Concept extends RDFFrame {
@Relation(label = "skos:narrower")
public abstract Collection<Concept> getNarrower();

@Relation(label = "skos:prefLabel")
public abstract Collection<PrefLabel> getPrefLabels();

public Collection<PrefLabel> getPrefLabels(String language) {
// Implementation: Return only PrefLabels in the requested
language. For instance "en"
}
}

I do not know if that works with abstract methods. So sorry for my ignorance.

Kind regards.

2011/8/8 Thomas Fritz <frit...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages