Re: [Wikidata-tech] Linking RDF resources for external IDs

2016-11-29 Thread Thad Guidry
Ok, thanks Daniel.

-Thad
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Linking RDF resources for external IDs

2016-11-14 Thread Daniel Kinzler
By the way, I'm also re-considering my original approach:

Simply replace the plain value with the resolved URI when we can. This would
*not* cause the same property to be used with literals and non-literals, since
the predicate name is derived from the proeprty ID, and a property either
provides a URI mapping, or it doesn't.

Problems would arise during transition, making this a breaking change:

1) when introducing this feature, existing queries that compare a newly
URI-ified property to a string literal will fail.

2) when a URI mapping is added, we'd either need to immediately update all
statements that use that property, or the triple store would have some old
triples where the relevant predicates point to a literal, and some new triples
where it pints to a resource.

This would avoid duplicating more predicates, and keeps the model straight
forward. But it would cause a bumpy transition.

Please let me know which approach you prefer. Have a look at the files attached
to my original message.

Thanks,
Daniel

Am 09.11.2016 um 17:46 schrieb Daniel Kinzler:
> Hi Stas, Markus, Denny!
> 
> For a long time now, we have been wanting to generate proper resource 
> references
> (URIs) for external identifier values, see
> .
> 
> Implementing this is complicated by the fact that "expanded" identifiers may
> occur in four different places in the data model (direct, statement, 
> qualifier,
> reference), and that we can't simply replace the old string value, we need to
> provide an additional value.
> 
> I have attached three files with snippets of three different RDF mappings:
> - Q111.ttl - the status quo, with normalized predicates declared but not used.
> - Q111.rc.ttl - modeling resource predicates separately from normalized 
> values.
> - Q111.norm.ttl - modeling resource predicates as normalized values.
> 
> The "rc" variant means more overhead, the "norm" variant may have semantic
> difficulties. Please look at the two options for the new mapping and let me 
> know
> which you like best. You can use a plain old diff between the files for a 
> first
> impression.
> 


-- 
Daniel Kinzler
Senior Software Developer

Wikimedia Deutschland
Gesellschaft zur Förderung Freien Wissens e.V.

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


[Wikidata-tech] Linking RDF resources for external IDs

2016-11-09 Thread Daniel Kinzler
Hi Stas, Markus, Denny!

For a long time now, we have been wanting to generate proper resource references
(URIs) for external identifier values, see
.

Implementing this is complicated by the fact that "expanded" identifiers may
occur in four different places in the data model (direct, statement, qualifier,
reference), and that we can't simply replace the old string value, we need to
provide an additional value.

I have attached three files with snippets of three different RDF mappings:
- Q111.ttl - the status quo, with normalized predicates declared but not used.
- Q111.rc.ttl - modeling resource predicates separately from normalized values.
- Q111.norm.ttl - modeling resource predicates as normalized values.

The "rc" variant means more overhead, the "norm" variant may have semantic
difficulties. Please look at the two options for the new mapping and let me know
which you like best. You can use a plain old diff between the files for a first
impression.

-- 
Daniel Kinzler
Senior Software Developer

Wikimedia Deutschland
Gesellschaft zur Förderung Freien Wissens e.V.
@prefix rdf:  .
@prefix xsd:  .
@prefix rdfs:  .
@prefix owl:  .
@prefix wikibase:  .
@prefix wdata:  .
@prefix wd:  .
@prefix wds:  .
@prefix wdref:  .
@prefix wdv:  .
@prefix wdt:  .
@prefix wdtn:  .
@prefix p:  .
@prefix ps:  .
@prefix psv:  .
@prefix psn:  .
@prefix pq:  .
@prefix pqv:  .
@prefix pqn:  .
@prefix pr:  .
@prefix prv:  .
@prefix prn:  .
@prefix wdno:  .
@prefix skos:  .
@prefix schema:  .
@prefix cc:  .
@prefix geo:  .
@prefix prov:  .

wd:Q111 a wikibase:Item ;
	rdfs:label "silver"@en ;
	skos:prefLabel "silver"@en ;
	schema:name "silver"@en ;
	wdt:P20 "asdfasdf" ;
	wdtn:P20  .

wd:Q111 p:P20 wds:Q111-5459c580-4b6f-c306-184f-b7fa132b32d8 .

wds:Q111-5459c580-4b6f-c306-184f-b7fa132b32d8 a wikibase:Statement,
		wikibase:BestRank ;
	wikibase:rank wikibase:NormalRank ;
	ps:P20 "asdfasdf" ;
	psn:P20  ;
	pq:P30 "qwertyqwerty" ;
	pqn:P30  ;
	prov:wasDerivedFrom wdref:7335a5598064cd8716cc9e31d164f2803e376b99 .

wdref:7335a5598064cd8716cc9e31d164f2803e376b99 a wikibase:Reference ;
	pr:P40 "zxcvbnzxcvbn" ;
	prn:P40  .
	
wd:P20 a wikibase:Property ;
	wikibase:propertyType  ;
	wikibase:directClaim wdt:P20 ;
	wikibase:directClaimNormalized wdtn:P20 ;
	wikibase:claim p:P20 ;
	wikibase:statementProperty ps:P20 ;
	wikibase:statementValue psv:P20 ;
	wikibase:statementValueNormalized psn:P20 ;
	wikibase:qualifier pq:P20 ;
	wikibase:qualifierValue pqv:P20 ;
	wikibase:qualifierValueNormalized pqn:P20 ;
	wikibase:reference pr:P20 ;
	wikibase:referenceValue prv:P20 ;
	wikibase:referenceValueNormalized prn:P20 ;
	wikibase:novalue wdno:P20 .

p:P20 a owl:ObjectProperty .

psv:P20 a owl:ObjectProperty .

pqv:P20 a owl:ObjectProperty .

prv:P20 a owl:ObjectProperty .

psn:P20 a owl:ObjectProperty .

pqn:P20 a owl:ObjectProperty .

prn:P20 a owl:ObjectProperty .

wdt:P20 a owl:DatatypeProperty .

ps:P20 a owl:DatatypeProperty .

pq:P20 a owl:DatatypeProperty .

pr:P20 a owl:DatatypeProperty .

wdtn:P20 a owl:ObjectProperty .

wdno:P20 a owl:Class ;
	owl:complementOf _:genid2 .

_:genid2 a owl:Restriction ;
	owl:onProperty wdt:P20 ;
	owl:someValuesFrom owl:Thing .

wd:P20 rdfs:label "MusicBrainz place ID"@en .
@prefix rdf:  .
@prefix xsd:  .
@prefix rdfs:  .
@prefix owl:  .
@prefix wikibase:  .
@prefix wdata:  .
@prefix wd: