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

Problem with termtype guessing #9

Closed
arenas-guerrero-julian opened this issue Jul 8, 2021 · 7 comments
Closed

Problem with termtype guessing #9

arenas-guerrero-julian opened this issue Jul 8, 2021 · 7 comments

Comments

@arenas-guerrero-julian
Copy link

R2RML spec says:

If the term map does not have a rr:termType property, then its term type is:
rr:Literal, if it is an object map and at least one of the following conditions is true:
It is a column-based term map.
It has a rr:language property (and thus a specified language tag).
It has a rr:datatype property (and thus a specified datatype).
rr:IRI, otherwise.

But when I have rr:object and I do not specify temtype the engines guesses it is a Literal even though none of the conditions abovce are met. E.g.:

rr:predicateObjectMap [
      rr:object "something";
      rr:predicate :ex
    ];
@chrdebru
Copy link
Owner

chrdebru commented Jul 8, 2021

Yes. That's because rr:object "literal" is shorthand for rr:objectMap [ rr:constant "literal" ; ]. So in this case, there is sufficient information to deduce that the constant is a literal.

In short: rr:object is a shorthand for constant-based term maps.

@arenas-guerrero-julian
Copy link
Author

Yes but imagine tou have rr:object "URI". What happens in that case?

@chrdebru
Copy link
Owner

chrdebru commented Jul 8, 2021

You provide a literal. If you want to provide an IRI for a resource description, then you provide rr:object <http://example.org/foo> ;

  • "http://foo/bar" is a literal
  • "http://foo/bar"^^xsd:anyURI is a typed literal
  • <http://foo/bar> is a named resource

@arenas-guerrero-julian
Copy link
Author

I see then the R2RML spec is missing one point:

  • It is a constant-based term map and the object is a literal.

@chrdebru
Copy link
Owner

chrdebru commented Jul 8, 2021

The paragraph of the spec you are referring to is concerned with column-based term maps. rr:object (and rr:graph and rr:predicate, for that matter) are all shorthand for constant-based term maps.

@chrdebru
Copy link
Owner

chrdebru commented Jul 8, 2021

The spec is clear in my opinion:

A constant-valued term map is a term map that ignores the logical table row and always generates the same RDF term. A constant-valued term map is represented by a resource that has exactly one rr:constant property.
The constant value of a constant-valued term map is the RDF term that is the value of its rr:constant property.
If the constant-valued term map is a subject map, predicate map or graph map, then its constant value must be an IRI.
If the constant-valued term map is an object map, then its constant value must be an IRI or literal.

When using rr:object, it is either an IRI or a literal, which is determined by "the syntax": <> vs. ""

@arenas-guerrero-julian
Copy link
Author

Actually they have a note I did not see:

Constant-valued term maps are not considered as having a term type, and specifying rr:termType on these term maps has no effect. The type of the generated RDF term is determined directly by the value of rr:constant: If it is an IRI, then an IRI will be generated; if it is a literal, a literal will be generated.

Sorry, I think this can be closed :) thank you!

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

2 participants