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

Allow prefixes in PropertyMapping #29

Closed
gaurav opened this issue Jul 14, 2014 · 19 comments · Fixed by dbpedia/extraction-framework#263
Closed

Allow prefixes in PropertyMapping #29

gaurav opened this issue Jul 14, 2014 · 19 comments · Fixed by dbpedia/extraction-framework#263

Comments

@gaurav
Copy link
Owner

gaurav commented Jul 14, 2014

A lot of the work is already done -- I've pulled it into my repo as https://github.com/gaurav/extraction-framework/tree/feature/prefix_in_propertymapping -- but it might need checking.

@jimkont
Copy link
Collaborator

jimkont commented Jul 14, 2014

Hey @ninniuz, @gaurav tries to merge your pull request, can you take a first review?

@ninniuz
Copy link
Collaborator

ninniuz commented Jul 14, 2014

I think this is basically what I put into the MR one year ago...

@gaurav
Copy link
Owner Author

gaurav commented Jul 15, 2014

@ninniuz: Yup, I haven't changed your code at all! I just pulled your code onto the end of the current dbpedia:master, so it can be automatically merged. It works locally, except for generating a duplicate triple: I added a "prefix" to http://mappings.dbpedia.org/index.php/Mapping_commons:NARA-image-full and got two triples:

We need to switch those triples to URIs and figure out why they're duplicating, but hopefully that won't take too long. Would you like to work on this or should I add it to my Google Summer of Code work?

@ninniuz
Copy link
Collaborator

ninniuz commented Jul 15, 2014

@gaurav please go ahead :)

@gaurav
Copy link
Owner Author

gaurav commented Jul 15, 2014

Oops: the duplicate and the ^^xsd:string were both a result of hasNationalArchivesIdentifier being a datatype property. Once I converted it into an object property, it turned into a URI and the duplicate went away. I've updated http://mappings.dbpedia.org/index.php/Template:PropertyMapping to display the prefix/suffix/transform and to include some basic documentation. I'll try to update some templates to use prefixes and suffixes: I've tried to set it up so that mappings containing these are categorized into http://mappings.dbpedia.org/index.php/Category:Mappings_using_prefix and http://mappings.dbpedia.org/index.php/Category:Mappings_using_suffix, but that doesn't seem to be working.

@ninniuz
Copy link
Collaborator

ninniuz commented Jul 16, 2014

I can see the categorization working. Got it fixed?

@gaurav
Copy link
Owner Author

gaurav commented Jul 16, 2014

I didn't do anything ... it just fixed itself :-P

@gaurav
Copy link
Owner Author

gaurav commented Jul 21, 2014

There are four cases to test:

  • Does the code work when the value is:
    • A string/number, or
    • A URI
  • Does the code work when the RDF property being produced is:
    • A DatatypeProperty
    • An ObjectProperty

For each case, we need to test both prefix and suffix.

@gaurav
Copy link
Owner Author

gaurav commented Jul 23, 2014

Properties tested:

@gaurav
Copy link
Owner Author

gaurav commented Jul 23, 2014

When would the value ever be a DatatypeProperty? I tried to do something with http://mappings.dbpedia.org/index.php/Mapping_commons:Doi, but I think the mapping to a DatatypeProperty (doi:10.123abc/d) is overridding the mapping to an OntologyProperty (http://dx.doi.org/wiki/10.123abc/d). Apart from units, I can't think of a case where something would need to be prefixed or suffixed to a produce a non-URI (although I'm sure I'll come up with something thirty seconds after posting this update :-P).

@jimkont
Copy link
Collaborator

jimkont commented Jul 23, 2014

I cannot think of one either atm :)
The thing is that we should test if it behaves correctly, if yes then
everything is good ;)
if not, we should either fix it or make the mapping invalid

For testing this you can try it out with any string datatype
e.g. dbo:longName, dbo:title or foaf:name, it doesn't have to make sense
for now, just see it it works
you can try mapping the same template property to

  1. foaf:name with prefix
  2. dbo:longName with suffix
  3. dbo:title with both
    Find 3 object properties as well and define them in a similar way

On Wed, Jul 23, 2014 at 7:07 AM, Gaurav Vaidya notifications@github.com
wrote:

When would the value ever be a DatatypeProperty? I tried to do something
with http://mappings.dbpedia.org/index.php/Mapping_commons:Doi, but I
think the mapping to a DatatypeProperty (doi:10.123abc/d) is overridding
the mapping to an OntologyProperty (http://dx.doi.org/wiki/10.123abc/d).
Apart from units, I can't think of a case where something would need to be
prefixed or suffixed to a produce a non-URI (although I'm sure I'll come up
with something thirty seconds after posting this update :-P).


Reply to this email directly or view it on GitHub
#29 (comment)
.

Kontokostas Dimitris

@gaurav
Copy link
Owner Author

gaurav commented Jul 27, 2014

Incidentally, http://mappings.dbpedia.org/index.php/Mapping_commons:Doi didn't work locally, so I think there is a problem with mapping the same value in two different ways, or maybe just how I did the mapping there.

@jimkont
Copy link
Collaborator

jimkont commented Jul 28, 2014

you mean it works with a single mapping in all different ways but not if
you define 2 or more?
maybe "1" is the problem here, can you exclude it and try with id only?

On Sun, Jul 27, 2014 at 6:42 PM, Gaurav Vaidya notifications@github.com
wrote:

Incidentally, http://mappings.dbpedia.org/index.php/Mapping_commons:Doi
didn't work locally, so I think there is a problem with mapping the same
value in two different ways, or maybe just how I did the mapping there.


Reply to this email directly or view it on GitHub
#29 (comment)
.

Kontokostas Dimitris

@gaurav
Copy link
Owner Author

gaurav commented Jul 28, 2014

OKAY

I think that means we're good to go? I'll look at it again tomorrow and check.

@jimkont
Copy link
Collaborator

jimkont commented Jul 28, 2014

so it was it a bug before or a wrong mapping?

On Mon, Jul 28, 2014 at 12:51 PM, Gaurav Vaidya notifications@github.com
wrote:

OKAY

http://mappings.dbpedia.org/index.php?title=Mapping_commons:Doi&oldid=37561
tests prefixes and suffixes for ObjectProperty and DatatypeProperty ->
https://gist.github.com/gaurav/06c25381e81de884e58f#file-doi-ttl

http://mappings.dbpedia.org/index.php?title=Mapping_commons:Chemical_structure_verified&oldid=37560
tests prefixes and suffixes together ->
https://gist.github.com/gaurav/06c25381e81de884e58f#file-chemstructure-ttl

I think that means we're good to go? I'll look at it again tomorrow and
check.


Reply to this email directly or view it on GitHub
#29 (comment)
.

Kontokostas Dimitris

@gaurav
Copy link
Owner Author

gaurav commented Jul 28, 2014

Ah, right. No, we don't have a working example for just prefix and just suffix on ObjectProperty. I'll try again.

@gaurav
Copy link
Owner Author

gaurav commented Jul 29, 2014

Ah, I knew I'd done prefixed ObjectProperties somewhere:

I've added a spurious suffix to an ObjectProperty at http://mappings.dbpedia.org/index.php/Mapping_commons:Flickr, but it's not working. I'll need to debug this further.

@gaurav
Copy link
Owner Author

gaurav commented Aug 4, 2014

@jimkont: Do you think it makes sense to add prefix/suffix code for ObjectProperties fas done in @2d6e3ff? It doesn't make much sense to have a prefix for URLs, but suffixes might make sense. Note that converting a text value into an ObjectProperty works fine (e.g. hasNationalArchivesIdentifier in http://mappings.dbpedia.org/index.php?title=Mapping_commons:NARA-image-full&oldid=36827): the problem is when the code can recognize a URL before it gets to us. @2d6e3ff fixes that, but I'm not sure if it's necessary. What do you think?

@jimkont
Copy link
Collaborator

jimkont commented Aug 4, 2014

Let's keep it I think. If it doesn't make sense, people won't use it.
Otherwise we should make the mapping invalid

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

Successfully merging a pull request may close this issue.

3 participants