Skip to content
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

Access to Linked Data #20

Closed
saqibrashed opened this issue May 7, 2013 · 4 comments
Closed

Access to Linked Data #20

saqibrashed opened this issue May 7, 2013 · 4 comments

Comments

@saqibrashed
Copy link

Get the clear idea about the linked data; come up with suggestions.

@ghost ghost assigned saqibrashed May 7, 2013
@dmth
Copy link
Member

dmth commented May 18, 2013

@autermann
Copy link
Member

very up-to-date

so up to date that nothing will support it :) but a nice and parsable alternative…

@autermann
Copy link
Member

I've implemented RDF support in 42e9daf (in a new lod branch) and created a very basic example in c773060:

@Override
public Model encodeRDF(User t, MediaType mt) {
    Model model = ModelFactory.createDefaultModel();
    URI uri = getUriInfo().getBaseUriBuilder()
            .path(RootResource.class)
            .path(RootResource.USERS)
            .path(UsersResource.USER).build(t.getName());
    model.createResource(uri.toASCIIString())
            .addProperty(VCARD.EMAIL, t.getMail())
            .addProperty(VCARD.NICKNAME, t.getName());
    return model;
}

It will result in this RDF output (I've implemented RDF/XML and Turtle encodings):

curl http://localhost:8080/webapp/rest/users/testuser1 -H "accept: application/rdf+xml"

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#">
  <rdf:Description rdf:about="http://localhost:8080/webapp/rest/users/testuser1">
    <vcard:NICKNAME>testuser1</vcard:NICKNAME>
    <vcard:EMAIL>testuser1@example.org</vcard:EMAIL>
  </rdf:Description>
</rdf:RDF>

curl http://localhost:8080/webapp/rest/users/testuser1 -H "accept: text/turtle"

<http://localhost:8080/webapp/rest/users/testuser1>
        <http://www.w3.org/2001/vcard-rdf/3.0#EMAIL>
                "testuser1@example.org" ;
        <http://www.w3.org/2001/vcard-rdf/3.0#NICKNAME>
                "testuser1" .

@autermann
Copy link
Member

Closed because the task is to unspecific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants