-
Notifications
You must be signed in to change notification settings - Fork 2
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
implement SchemaMappingImpl #199
Comments
Is SchemaMappingImpl dependent on EntityMappingImpl? SchemaMapping.java mentions "(i.e., applying this entity mapping to the solution mapping does not have any effect)", is this a typo from copying over the definitions of EntityMapping's methods? Also, what exactly is SchemaMapping? The brief description I see in SchemaMapping.java doesn't give me a clear view of what the methods in the class are supposed to do when fully implemented. |
No.
Yes, that was a typical copy-paste error. I have fixed it in commit 4ad03d7
As you may remember, RDF vocabularies / ontologies introduce classes and properties which can be used in RDF triples that represent statements about instances of the classes. For instance, the FOAF vocabulary contains the class of persons for which it introduces the URI http://xmlns.com/foaf/0.1/Person (or,
The properties that RDF vocabulary define can be used in the predicate position of triples. For instance:
Now, entity mappings are about the URIs for the things that we can describe using such vocabularies (e.g., http://example.org/Bob and http://example.org/Ali in the example). Schema mappings are about the properties and the classes defined in the vocabularies. For instance, a schema mapping may define that the class denoted by the URI foaf:Person is equivalent to the class denoted by the URI http://example.org/HumanBeing or that the class with URI foaf:Person is a subclass of the class with URI foaf:Agent. Juliette's thesis draft covers several such types of relationships between classes and also between properties. A schema mapping may contain all of them (except for the owl:sameAs relationships, which are for entity mappings). Unfortunately, the Does this help? Let me know if you have further questions. |
Yeah, this helps quite a bit. I have some further questions, first off: The implementation's TODO wants me to define 'TermMapping' and implement classes. After looking at the page you linked to, I still don't know what 'Term' means in this context. What relationships between classes exist, which the SchemaMappingImpl should be aware of (if any)? I see "equivalent to" and "subclass of" as two examples, are there more? I see that the TODO states that Node should be the key value in g2lMap - just like in EntityMappingImpl. Can Node be anything? A literal? A URI? Furthermore regarding the g2lMap, should an l2gMap in the same vein as EntityMappingImpl also be created? If so, is applyInverseToSolutionMapping the 'mirror image' as it is in EntityMappingImpl, or something else? If not, I assume the applyInverseToSolutionMapping would work as a 'any of these locals are renamed to this global', but I'm not sure because this isn't a Node-to-Node mapping as it was in EntityMappingImpl. From what I can see on the FOAF webpage, I have a hint that these foaf-classes are pre-defined and finite. Is this correct? As in, the classes listed on the FOAF webpage are all FOAF classes which exist and they have set properties which can be specified - and also seems like not all properties have to be specified. |
By "terms" I mean the URIs that identify classes and properties as introduced by the vocabularies. For instance, foaf:Person is a term, and so is foaf:knows. In the Jena API, such terms are objects of the Java class Now, regarding For example, the "equivalent to" relationships that can exists between classes would be captured as one such Java class that implements What function declarations the
This is in Juliette's thesis report. I will email you a recent draft that she just sent yesterday. In that one, the relevant section for your question here is Section 4.2.2.
Short answer, that still needs to be defined. Longer answer: Remember that both your and Juliette's thesis work considers only the cases in which solution mappings need to be translated from the local vocabulary of a federation member to the global vocabulary. That would be applying the inverse of a schema mapping to such solution mappings (which your next question was about---answer below). In other words, for both your theses, you are not considering cases in which solution mappings that contain terms of the global vocabulary need to be translated by applying our global-to-local schema mappings to them. That's why this part is still undefined. Creating this definition is perhaps not too difficult because it would be similar to how the schema mappings are applied to triple patterns. However, I suggest to ignore this part for the moment and, instead, first focus on implementing the functions of
See Section 4.4 in the latest draft of Juliette's thesis report that I will email you. Remember, however, that Juliette's notion of "vocabulary mapping" mixes the concept of a schema mapping with the concept of an entity mapping. Hence, for the schema mapping, you can ignore the parts of Juliette's description that are about owl:sameAs.
The rewriting of triple patterns is defined in Section 4.3 of Juliette's latest draft (also here, ignore the parts that are about owl:sameAs). For your given example, assuming that foaf:Person is in the global vocabulary and foaf:Agent in the local one, there is no way to correctly rewrite your given triple pattern and, thus, by the definition, the triple pattern would remain as is. An alternative example would be a triple pattern (?x, rdf:type, foaf:Agent) with foaf:Agent in the global vocabulary and foaf:Person in the local one. In this case, the triple pattern would be rewritten to (?x, rdf:type, foaf:Person). Informally, you can think of this rewriting as follows: the given triple pattern wants to retrieve all agents and, by the schema mapping, we know that persons are agents; therefore, we can retrieve all persons from the federation member that uses the local vocabulary with foaf:Person and return all these persons as solutions for the given triple pattern.
In general, yes. The Jena class
I think yes.
Yes. However, please do not get hung up too much on the FOAF vocabulary. That was just an example.
domain and range are general concepts for RDF vocabularies. In other words, there is nothing specific about them in the context of FOAF. As a reminder what these concepts mean, you can take a look again at Section 4 of the RDF primer document I pointed you to much earlier: https://www.w3.org/TR/rdf11-primer/#section-vocabulary |
@SHSenpai this one is for you. See the new class
SchemaMappingImpl
as added in commit 45695d6 This class needs to be implemented (there are several TODOs in the class), including a corresponding test class with some unit testsSchemaMappingImpl
.To this after addressing #198
The text was updated successfully, but these errors were encountered: