You might look at how PA4RDF handled the problem.
https://github.com/Claudenw/PA4RDF
in
https://github.com/Claudenw/PA4RDF/blob/master/src/main/java/org/xenei/jena/entities/impl/PredicateInfoImpl.java
the method getHandler() has code that determines what the return type is
for a literal. The
On 12/01/2017 11:31, Dave Reynolds wrote:
>
> On 12/01/17 10:15, George News wrote:
>> BTW I think I found a bug:
>>
>> String b = "http://datypic.com/fraf1;;
>> Literal a = (Literal) ResourceFactory.createTypedLiteral(b,
>> XSDDatatype.XSDanyURI);
>> System.out.println(a.getDatatype());
>>
On 12/01/2017 11:33, Rob Vesse wrote:
> Why are you using literals to represent URIs?
>
> Most people would just use URIs since they are first-class citizens in the
> RDF datamodel. It seems like you are forcing yourself through unnecessary
> hoops
It's representing an endpoint to access a
Why are you using literals to represent URIs?
Most people would just use URIs since they are first-class citizens in the RDF
datamodel. It seems like you are forcing yourself through unnecessary hoops
Rob
On 12/01/2017 10:15, "George News" wrote:
BTW I think I found
On 12/01/17 10:15, George News wrote:
BTW I think I found a bug:
String b = "http://datypic.com/fraf1;;
Literal a = (Literal) ResourceFactory.createTypedLiteral(b,
XSDDatatype.XSDanyURI);
System.out.println(a.getDatatype());
System.out.println(a.getValue().getClass());
a = (Literal)
BTW I think I found a bug:
String b = "http://datypic.com/fraf1;;
Literal a = (Literal) ResourceFactory.createTypedLiteral(b,
XSDDatatype.XSDanyURI);
System.out.println(a.getDatatype());
System.out.println(a.getValue().getClass());
a = (Literal)
On 12/01/2017 9:58, Chris Dollin wrote:
>
>
> On 12/01/17 08:41, George News wrote:
>>
>>
>> On 11/01/2017 18:17, A. Soroka wrote:
>>> And I and Chris Dollin answered your question. Again,
>>>
>>> ResourceFactory.createTypedLiteral("http://hola^^http://www.w3.org/2001/XMSchema#anyURI;,
>>>
Exactly, first argument is the value, second one declares the datatype -
here XSDDatatype.XSDanyURI, see the Javadoc [1]
[1]
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/ResourceFactory.html#createTypedLiteral-java.lang.String-org.apache.jena.datatypes.RDFDatatype-
On 12/01/17 08:41, George News wrote:
On 11/01/2017 18:17, A. Soroka wrote:
And I and Chris Dollin answered your question. Again,
ResourceFactory.createTypedLiteral("http://hola^^http://www.w3.org/2001/XMSchema#anyURI;,
XSDDatatype.XSDanyURI)
That should be:
On 12/01/17 08:41, George News wrote:
On 11/01/2017 18:17, A. Soroka wrote:
And I and Chris Dollin answered your question. Again,
ResourceFactory.createTypedLiteral("http://hola^^http://www.w3.org/2001/XMSchema#anyURI;,
XSDDatatype.XSDanyURI)
Don't do a bunch of string processing.
As I
On 11/01/2017 18:17, A. Soroka wrote:
> And I and Chris Dollin answered your question. Again,
>
> ResourceFactory.createTypedLiteral("http://hola^^http://www.w3.org/2001/XMSchema#anyURI;,
> XSDDatatype.XSDanyURI)
>
> Don't do a bunch of string processing.
As I said there is no way of getting
You do know the type: http://www.w3.org/2001/XMSchema#anyURI
It is clearly written in your example.
---
A. Soroka
The University of Virginia Library
> On Jan 11, 2017, at 10:25 AM, George News wrote:
>
> On 11/01/2017 15:59, A. Soroka wrote:
>> Perhaps parse it as a Jena
On 11/01/17 15:42, George News wrote:
Literal a = (Literal)
ResourceFactory.createTypedLiteral("http://hola^^http://www.w3.org/2001/XMSchema#anyURI;,
XSDDatatype.XSDanyURI);
System.out.println(a.getDatatype());
System.out.println(a.getLexicalForm());
System.out.println(a.getDatatypeURI());
At the end I decide to take a shortcut that also might help explain what
I want:
|private URI rdfLiteralToUri(String literal) { int xsdIndex =
literal.lastIndexOf("^^"); if (xsdIndex == -1) { throw new
IllegalArgumentException("Not valid literal format"); } String uriStr =
literal.substring(0,
On 11/01/2017 16:25, Chris Dollin wrote:
>
>
> On 11/01/17 14:55, George News wrote:
>> Hi,
>>
>> I have this literal:
>> http://hola^^http://www.w3.org/2001/XMSchema#anyURI
>
> What do you mean by "have"? A String value, a Literal
> value, or what?
I want to get http://hola as a String or as
On 11/01/17 14:55, George News wrote:
Hi,
I have this literal:
http://hola^^http://www.w3.org/2001/XMSchema#anyURI
What do you mean by "have"? A String value, a Literal
value, or what?
And I want to create a URI from it. Is there any way to do so?
And do you want an actual URI object or
On 11/01/2017 15:59, A. Soroka wrote:
> Perhaps parse it as a Jena Literal (e.g. using
> ResourceFactory.createTypedLiteral() ), then use Literal.getString() to get
> the value you seek.
then I need to know the type. The issue is that I wanted to know if
there is any Jena function that directly
Perhaps parse it as a Jena Literal (e.g. using
ResourceFactory.createTypedLiteral() ), then use Literal.getString() to get the
value you seek.
---
A. Soroka
The University of Virginia Library
> On Jan 11, 2017, at 9:55 AM, George News wrote:
>
> Hi,
>
> I have this
18 matches
Mail list logo