Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-17 Thread Kingsley Idehen
On 10/17/16 3:03 PM, Thad Guidry wrote:
> Kingsley,
>
> The http://pending.schema.org namespace will show up as this in RDF Turtle
>
> ns1:Q1251750  owl:equivalentClass ns3:Distillery .
> and this way in JSON-LD
>
> {
>
>  *
> @id: "http://www.wikidata.org/entity/Q1251750;,
>  *
> equivalentClass: "http://pending.schema.org/Distillery;
>
> },
> Thad
> +ThadGuidry 

Thad,

I assume you will have @context in the JSON-LD doc preamble with regards
to owl: namespace mapping to "equivalentClass" ?

Anyway, here are some live examples of the effects of mappings (classes
and properties) across wikidata, schema.org, and dbpedia vocabularies
using the latest edition of DBpedia.


[1]
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fontology%2FAirport=urn%3Adbpedia%3Awikidata%3Aschema%3Amapping%3Ainference%3Arules=1
-- With Inference Context

[2]
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fontology%2FAirport=1
-- Without Inference Context

[3]
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fontology%2FBook=urn%3Adbpedia%3Awikidata%3Aschema%3Amapping%3Ainference%3Arules=1
-- With Inference Context

[4]
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fontology%2FBook=1
-- Without Inference Context

-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



smime.p7s
Description: S/MIME Cryptographic Signature
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-17 Thread Thad Guidry
Oops !  one more thing about the mappings that I forgot to mention to all.
Which is very important.

http://pending.schema.org

That is were schema.org holds its work-in-progress or review of a draft
idea for Classes (Types) and Properties.

We have already mapped several of them that are currently in
http://pending.schema.org and those also show in the Schema.org-WD mappings.
There is some usefulness for doing this ahead of time, so that way we can
see upcoming overlap and raise issues on either WD or Schema.org side.
BUT NOTE: http://pending.schema.org is not a final view or official release
and so those particular mappings against that subdomain MIGHT BE SUBJECT TO
CHANGE IN THE FUTURE.

As already mentioned in our Schema.org issue, We (Thad and others) will
continue to update the mappings inside Wikidata as we go forward with
Schema.org changes and releases and where things move out of pending and
into our current release.


On Mon, Oct 17, 2016 at 1:45 PM Thad Guidry  wrote:

> Nice Kingsley!  Great work.  So nowthe bad news and where we need
> further help still :)
>
> I do want to let everyone know however that within Classes and
> Properties...there are a slight few mappings that were taken as an
> opinionated view
>
> I.E. they may slightly conflict with other views of the mappings in
> Languages that are not English. Or might not seem correctly mapped or
> aligned.
> But I think most folks know that around here and deal with that everyday
> in Wikipedia and Wikidata.
>
> Still, we encourage all communities to review the Schema.org-WD mappings
> and voice any issues, errors, mistakes, or alternative viewpoints in this
> Wikidata mailing list or the Schema.org mailing list or our Schema.org
> Github issues.
>
> Thad
> +ThadGuidry 
>
>
> On Mon, Oct 17, 2016 at 1:26 PM Kingsley Idehen 
> wrote:
>
> On 10/11/16 2:48 PM, Thad Guidry wrote:
>
> Kingsley,
>
> You might ask others on the list who could help more with providing the WD
> - Schema.org mappings or get them into a format that you want...or an RDF
> dump file.
>
> I just don't have the knowledge to assist you with that via SPARQL.
>  (i.e., I am not a SPARQL guru)
>
> -Thad
>
>
> ___
> Wikidata mailing 
> listWikidata@lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
> Thad,
>
> Having figured out how the Wikidata SPARQL endpoint works, here are the
> mappings between Wikidata and Schema.org using owl:equivalentClass and
> owl:equivalentProperty relations. Basically, I am using SPARQL-FED to
> produce the desired result using a variety of RDF related document types
> (JSON-LD. RDF-Turtle, HTML5+Microdata, and XHTML+RDFa).
>
> We will load this into the DBpedia DBMS which will make this data
> available via SPARQL and relevant Linked Data pages, now that the new
> 2016-04 release is live [1].
>
>
> # Equivalent Property Relations Generation #
>
> PREFIX wdt: 
> 
>
> CONSTRUCT {?s owl:equivalentProperty ?o}
> WHERE { SERVICE 
> 
> {
>  SELECT ?s ?equivalentProperty ?o
>  WHERE {
>   ?s wdt:P1628 ?o .
>   BIND (wdt:P1628 as ?equivalentProperty)
>   FILTER( REGEX(STR(?o), "schema.org"))
>}
> }
>}
>
> Live Links:
>
> [1]
> http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==application%2Fld%2Bjson_redir_for_subjs=121_redir_for_hrefs==3000
> -- JSON-LD
>
> [2]
> 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-17 Thread Thad Guidry
Kingsley,

The http://pending.schema.org namespace will show up as this in RDF Turtle

ns1:Q1251750owl:equivalentClass ns3:Distillery .

and this way in JSON-LD

{

   - @id: "http://www.wikidata.org/entity/Q1251750;,
   - equivalentClass: "http://pending.schema.org/Distillery;

},

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


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-17 Thread Thad Guidry
Nice Kingsley!  Great work.  So nowthe bad news and where we need
further help still :)

I do want to let everyone know however that within Classes and
Properties...there are a slight few mappings that were taken as an
opinionated view

I.E. they may slightly conflict with other views of the mappings in
Languages that are not English. Or might not seem correctly mapped or
aligned.
But I think most folks know that around here and deal with that everyday in
Wikipedia and Wikidata.

Still, we encourage all communities to review the Schema.org-WD mappings
and voice any issues, errors, mistakes, or alternative viewpoints in this
Wikidata mailing list or the Schema.org mailing list or our Schema.org
Github issues.

Thad
+ThadGuidry 


On Mon, Oct 17, 2016 at 1:26 PM Kingsley Idehen 
wrote:

> On 10/11/16 2:48 PM, Thad Guidry wrote:
>
> Kingsley,
>
> You might ask others on the list who could help more with providing the WD
> - Schema.org mappings or get them into a format that you want...or an RDF
> dump file.
>
> I just don't have the knowledge to assist you with that via SPARQL.
>  (i.e., I am not a SPARQL guru)
>
> -Thad
>
>
> ___
> Wikidata mailing 
> listWikidata@lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
> Thad,
>
> Having figured out how the Wikidata SPARQL endpoint works, here are the
> mappings between Wikidata and Schema.org using owl:equivalentClass and
> owl:equivalentProperty relations. Basically, I am using SPARQL-FED to
> produce the desired result using a variety of RDF related document types
> (JSON-LD. RDF-Turtle, HTML5+Microdata, and XHTML+RDFa).
>
> We will load this into the DBpedia DBMS which will make this data
> available via SPARQL and relevant Linked Data pages, now that the new
> 2016-04 release is live [1].
>
>
> # Equivalent Property Relations Generation #
>
> PREFIX wdt: 
> 
>
> CONSTRUCT {?s owl:equivalentProperty ?o}
> WHERE { SERVICE 
> 
> {
>  SELECT ?s ?equivalentProperty ?o
>  WHERE {
>   ?s wdt:P1628 ?o .
>   BIND (wdt:P1628 as ?equivalentProperty)
>   FILTER( REGEX(STR(?o), "schema.org"))
>}
> }
>}
>
> Live Links:
>
> [1]
> http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==application%2Fld%2Bjson_redir_for_subjs=121_redir_for_hrefs==3000
> -- JSON-LD
>
> [2]
> http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==text%2Fturtle_redir_for_subjs=121_redir_for_hrefs==3000
> -- RDF-Turtle
>
> [3]
> http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==text%2Fhtml_redir_for_subjs=121_redir_for_hrefs==3000
>
> [4]
> 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-17 Thread Kingsley Idehen
On 10/11/16 2:48 PM, Thad Guidry wrote:
> Kingsley,
>
> You might ask others on the list who could help more with providing
> the WD - Schema.org mappings or get them into a format that you
> want...or an RDF dump file.
>
> I just don't have the knowledge to assist you with that via SPARQL.
>  (i.e., I am not a SPARQL guru)
>
> -Thad
>
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata

Thad,

Having figured out how the Wikidata SPARQL endpoint works, here are the
mappings between Wikidata and Schema.org using owl:equivalentClass and
owl:equivalentProperty relations. Basically, I am using SPARQL-FED to
produce the desired result using a variety of RDF related document types
(JSON-LD. RDF-Turtle, HTML5+Microdata, and XHTML+RDFa).

We will load this into the DBpedia DBMS which will make this data
available via SPARQL and relevant Linked Data pages, now that the new
2016-04 release is live [1].


# Equivalent Property Relations Generation #

PREFIX wdt: 

CONSTRUCT {?s owl:equivalentProperty ?o} 
WHERE { SERVICE  
{ 
 SELECT ?s ?equivalentProperty ?o
 WHERE {
  ?s wdt:P1628 ?o .
  BIND (wdt:P1628 as ?equivalentProperty)
  FILTER( REGEX(STR(?o), "schema.org"))
   }
}   
   }
  
Live Links:

[1]
http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==application%2Fld%2Bjson_redir_for_subjs=121_redir_for_hrefs==3000
-- JSON-LD

[2]
http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==text%2Fturtle_redir_for_subjs=121_redir_for_hrefs==3000
-- RDF-Turtle

[3]
http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==text%2Fhtml_redir_for_subjs=121_redir_for_hrefs==3000

[4]
http://linkeddata.uriburner.com/sparql?default-graph-uri==PREFIX+wdt%3A+%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E+%0D%0A%0D%0ACONSTRUCT+%7B%3Fs+owl%3AequivalentProperty+%3Fo%7D++%0D%0AWHERE+%7B+SERVICE+%3Chttp%3A%2F%2Fquery.wikidata.org%2Fsparql%3E++%0D%0A%7B++%0D%0A+SELECT+%3Fs+%3FequivalentProperty+%3Fo%0D%0A+WHERE+%7B+%0D%0A%09%09%09%09%09+%09%09+%3Fs+wdt%3AP1628+%3Fo+.+%0D%0A%09%09%09%09%09+%09%09+BIND+%28wdt%3AP1628+as+%3FequivalentProperty%29%0D%0A+%09%09+FILTER%28+REGEX%28STR%28%3Fo%29%2C+%22schema.org%22%29%29+%0D%0A%09%09%09%09%09%09+++%7D%0D%0A%7D%0D%0A+++%7D==application%2Fxhtml%2Bxml_redir_for_subjs=121_redir_for_hrefs==3000
-- XHTML+RDFa


# Equivalent Class  Relations Generation #

PREFIX wdt: 

CONSTRUCT {?s ?equivalentClass ?o} 
WHERE { SERVICE  
 { 
SELECT ?s ?equivalentClass ?o
   

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-12 Thread Kingsley Idehen
On 10/11/16 2:23 PM, Thad Guidry wrote:
> Kingsley,
>
> You might ask others on the list who could help more with providing
> the WD - Schema.org mappings or get them into a format that you
> want...or an RDF dump file.
>
> I just don't have the knowledge to assist you with that via SPARQL.
>  (i.e., I am not a SPARQL guru)

Thad,

I assumed an understanding of how wikidata models properties. Anyway,
I'll take a look as what I requested should be possible, assuming there
isn't new bent on RDF data modeling that exist in this data.

I'll take it from here.

Thanks for your assistance :)

Kingsley
>
>
> On Tue, Oct 11, 2016 at 1:11 PM Kingsley Idehen
> > wrote:
>
> On 10/10/16 5:31 PM, Thad Guidry wrote:
>> Kingsley,
>>
>> use shortcut syntax instead. Also look at how the many examples
>> show doing tihngs.
>> http://tinyurl.com/hkv8z7m
>
> Thad,
>
> Not getting the point you are trying to articulate i.e., the
> solution isn't comprised strictly of
> 
>  relations.
>
> I am assuming 
>  identifies
> equivalentClass relations i.e.,
> 
>  
> owl:equivalentProperty owl:equivalentClass .
>
> You should be able to articulate the equivalent of the following,
> using SPARQL against Wikidata:
>
> SELECT DISTINCT ?s ?relation ?o
> WHERE { ?s owl:equivalentClass ?o.
> BIND (owl:equivalentClass AS ?relation)
> FILTER (isIRI(?s))
> FILTER (isIRI(?o))
>   }
> LIMIT 100
>
> Live Solution Link:
> 
> http://lod.openlinksw.com/sparql?default-graph-uri==SELECT+DISTINCT+%3Fs+%3Frelation+%3Fo%0D%0AWHERE+%7B+%3Fs+owl%3AequivalentClass+%3Fo.%0D%0ABIND+%28owl%3AequivalentClass+AS+%3Frelation%29%0D%0AFILTER+%28isIRI%28%3Fs%29%29+%0D%0AFILTER+%28isIRI%28%3Fo%29%29%0D%0A++%7D%0D%0ALIMIT+100=text%2Fx-html%2Btr_redir_for_subjs=121_redir_for_hrefs==3=on
>
>
> Kingsley
>>
>> On Mon, Oct 10, 2016 at 1:50 PM Kingsley Idehen
>> > wrote:
>>
>> On 10/9/16 1:34 PM, Thad Guidry wrote:
>>> Kingsley,
>>>
>>> The mappings are already in Wikidata (we still have a few
>>> properties left to map, but the classes are done, except for
>>> a few in pending.schema.org . 
>>> You can just query them in some fashion such as
>>> this: http://tinyurl.com/h9vjqd8
>>
>> Thad,
>>
>> Shouldn't the following query return all Classes
>> participating in an
>> 
>>  relation? :
>>
>> SELECT ?s ?relation ?o
>> WHERE { ?s 
>>  ?o.
>> BIND (
>>  AS ?relation)
>>   }
>> LIMIT 100
>>
>> Query Link:
>> 
>> https://query.wikidata.org/#%0A%0ASELECT%20%3Fs%20%3Frelation%20%3Fo%0AWHERE%20%7B%20%3Fs%20%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20%3Fo.%20%0A%20%20%20%20%20%20%20%20BIND%20%28%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20AS%20%3Frelation%29%20%0A%20%20%20%20%20%20%7D%20%0ALIMIT%20100%0A
>>
>> If not, can you formulate something closer to that output
>> which makes matters easier should you not have an RDF dump
>> available etc..
>>
>>
>> Kingsley
>>
>>>
>>> On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen
>>> > wrote:
>>>
>>> On 10/8/16 5:04 PM, Thad Guidry wrote:

 Class mappings are almost complete Kingsley. We were
 trying to get Wikidata to the point where it is easy
 for folks to do trivial queries right inside WDQS as
 part of WD Goals for 2016.

>>>
>>> Thad,
>>>
>>> Here is a post (brought up to date in last day) that
>>> demonstrates owl:equivalentClass reasoning and
>>> inference. Once I have a link to the new mappings I will
>>> integrate into this demo.
>>>
>>> Note, this particular LOD Cloud Cache instance has 30
>>> Billion+ triples against which the owl:equivalentClass
>>> inference is being applied, at query evaluation time.
>>>
>>> [1]
>>> 
>>> 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-11 Thread Thad Guidry
Kingsley,

You might ask others on the list who could help more with providing the WD
- Schema.org mappings or get them into a format that you want...or an RDF
dump file.

I just don't have the knowledge to assist you with that via SPARQL.  (i.e.,
I am not a SPARQL guru)

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


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-11 Thread Thad Guidry
Kingsley,

You might ask others on the list who could help more with providing the WD
- Schema.org mappings or get them into a format that you want...or an RDF
dump file.

I just don't have the knowledge to assist you with that via SPARQL.  (i.e.,
I am not a SPARQL guru)


On Tue, Oct 11, 2016 at 1:11 PM Kingsley Idehen 
wrote:

> On 10/10/16 5:31 PM, Thad Guidry wrote:
>
> Kingsley,
>
> use shortcut syntax instead. Also look at how the many examples show doing
> tihngs.
> http://tinyurl.com/hkv8z7m
>
>
> Thad,
>
> Not getting the point you are trying to articulate i.e., the solution
> isn't comprised strictly of 
>  relations.
>
> I am assuming 
>  identifies equivalentClass
> relations i.e., 
>   owl:equivalentProperty
> owl:equivalentClass .
>
> You should be able to articulate the equivalent of the following, using
> SPARQL against Wikidata:
>
> SELECT DISTINCT ?s ?relation ?o
> WHERE { ?s owl:equivalentClass ?o.
> BIND (owl:equivalentClass AS ?relation)
> FILTER (isIRI(?s))
> FILTER (isIRI(?o))
>   }
> LIMIT 100
>
> Live Solution Link:
>
> http://lod.openlinksw.com/sparql?default-graph-uri==SELECT+DISTINCT+%3Fs+%3Frelation+%3Fo%0D%0AWHERE+%7B+%3Fs+owl%3AequivalentClass+%3Fo.%0D%0ABIND+%28owl%3AequivalentClass+AS+%3Frelation%29%0D%0AFILTER+%28isIRI%28%3Fs%29%29+%0D%0AFILTER+%28isIRI%28%3Fo%29%29%0D%0A++%7D%0D%0ALIMIT+100=text%2Fx-html%2Btr_redir_for_subjs=121_redir_for_hrefs==3=on
>
>
> Kingsley
>
>
> On Mon, Oct 10, 2016 at 1:50 PM Kingsley Idehen 
> wrote:
>
> On 10/9/16 1:34 PM, Thad Guidry wrote:
>
> Kingsley,
>
> The mappings are already in Wikidata (we still have a few properties left
> to map, but the classes are done, except for a few in pending.schema.org.
> You can just query them in some fashion such as this:
> http://tinyurl.com/h9vjqd8
>
>
> Thad,
>
> Shouldn't the following query return all Classes participating in an
> 
>  relation? :
>
> SELECT ?s ?relation ?o
> WHERE { ?s 
>  ?o.
> BIND (
>  AS ?relation)
>   }
> LIMIT 100
>
> Query Link:
> https://query.wikidata.org/#%0A%0ASELECT%20%3Fs%20%3Frelation%20%3Fo%0AWHERE%20%7B%20%3Fs%20%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20%3Fo.%20%0A%20%20%20%20%20%20%20%20BIND%20%28%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20AS%20%3Frelation%29%20%0A%20%20%20%20%20%20%7D%20%0ALIMIT%20100%0A
>
> If not, can you formulate something closer to that output which makes
> matters easier should you not have an RDF dump available etc..
>
>
> Kingsley
>
>
> On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen 
> wrote:
>
> On 10/8/16 5:04 PM, Thad Guidry wrote:
>
> Class mappings are almost complete Kingsley. We were trying to get
> Wikidata to the point where it is easy for folks to do trivial queries
> right inside WDQS as part of WD Goals for 2016.
>
>
> Thad,
>
> Here is a post (brought up to date in last day) that demonstrates
> owl:equivalentClass reasoning and inference. Once I have a link to the new
> mappings I will integrate into this demo.
>
> Note, this particular LOD Cloud Cache instance has 30 Billion+ triples
> against which the owl:equivalentClass inference is being applied, at query
> evaluation time.
>
> [1]
> http://kidehen.blogspot.com/2014/02/class-equivalence-based-reasoning.html
>
>
> Kingsley
>
>
> On Sat, Oct 8, 2016, 2:38 PM Kingsley Idehen 
> wrote:
>
> On 10/6/16 2:57 PM, Thad Guidry wrote:
>
> Hello team :)
>
> So while I'm helping with the Wikidata - Schema.org mappings, a request
> came in to expose subcategories of an existing Wikipedia category.
>
> For example, say I start with this topic:
> https://www.wikidata.org/wiki/Q27119725  Parking facilities
>
> The topic's main category is shown as "Category:Parking facilities" and
> that has links to Wikipedia, specifically a Wikipedia category link, and
> where the WP category page has subcategories that I would like to expose
> somehow in whichever way is *easiest* currently with our tools, apis, etc.
>
> Can it all be done in SPARQL against some services that already expose WP
> subcategories given a specific category ?  Or is there an API that does
> this already ?  other tools that might expose WP categories ?
>
> The IDEAL GOAL is to query 'equivalent class' = schema.org/ParkingFacility
> and get back the WP categories *in one shot 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-11 Thread Kingsley Idehen
On 10/10/16 5:31 PM, Thad Guidry wrote:
> Kingsley,
>
> use shortcut syntax instead. Also look at how the many examples show
> doing tihngs.
> http://tinyurl.com/hkv8z7m

Thad,

Not getting the point you are trying to articulate i.e., the solution
isn't comprised strictly of

 relations.

I am assuming 
 identifies
equivalentClass relations i.e.,

  owl:equivalentProperty
owl:equivalentClass .

You should be able to articulate the equivalent of the following, using
SPARQL against Wikidata:

SELECT DISTINCT ?s ?relation ?o
WHERE { ?s owl:equivalentClass ?o.
BIND (owl:equivalentClass AS ?relation)
FILTER (isIRI(?s))
FILTER (isIRI(?o))
  }
LIMIT 100

Live Solution Link:
http://lod.openlinksw.com/sparql?default-graph-uri==SELECT+DISTINCT+%3Fs+%3Frelation+%3Fo%0D%0AWHERE+%7B+%3Fs+owl%3AequivalentClass+%3Fo.%0D%0ABIND+%28owl%3AequivalentClass+AS+%3Frelation%29%0D%0AFILTER+%28isIRI%28%3Fs%29%29+%0D%0AFILTER+%28isIRI%28%3Fo%29%29%0D%0A++%7D%0D%0ALIMIT+100=text%2Fx-html%2Btr_redir_for_subjs=121_redir_for_hrefs==3=on

Kingsley
>
> On Mon, Oct 10, 2016 at 1:50 PM Kingsley Idehen
> > wrote:
>
> On 10/9/16 1:34 PM, Thad Guidry wrote:
>> Kingsley,
>>
>> The mappings are already in Wikidata (we still have a few
>> properties left to map, but the classes are done, except for a
>> few in pending.schema.org .  You can
>> just query them in some fashion such as
>> this: http://tinyurl.com/h9vjqd8
>
> Thad,
>
> Shouldn't the following query return all Classes participating in
> an 
>  relation? :
>
> SELECT ?s ?relation ?o
> WHERE { ?s 
>  ?o.
> BIND (
>  AS ?relation)
>   }
> LIMIT 100
>
> Query Link:
> 
> https://query.wikidata.org/#%0A%0ASELECT%20%3Fs%20%3Frelation%20%3Fo%0AWHERE%20%7B%20%3Fs%20%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20%3Fo.%20%0A%20%20%20%20%20%20%20%20BIND%20%28%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20AS%20%3Frelation%29%20%0A%20%20%20%20%20%20%7D%20%0ALIMIT%20100%0A
>
> If not, can you formulate something closer to that output which
> makes matters easier should you not have an RDF dump available etc..
>
>
> Kingsley
>
>>
>> On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen
>> > wrote:
>>
>> On 10/8/16 5:04 PM, Thad Guidry wrote:
>>>
>>> Class mappings are almost complete Kingsley. We were trying
>>> to get Wikidata to the point where it is easy for folks to
>>> do trivial queries right inside WDQS as part of WD Goals for
>>> 2016.
>>>
>>
>> Thad,
>>
>> Here is a post (brought up to date in last day) that
>> demonstrates owl:equivalentClass reasoning and inference.
>> Once I have a link to the new mappings I will integrate into
>> this demo.
>>
>> Note, this particular LOD Cloud Cache instance has 30
>> Billion+ triples against which the owl:equivalentClass
>> inference is being applied, at query evaluation time.
>>
>> [1]
>> 
>> http://kidehen.blogspot.com/2014/02/class-equivalence-based-reasoning.html
>>
>>
>> Kingsley
>>>
>>> On Sat, Oct 8, 2016, 2:38 PM Kingsley Idehen
>>> > wrote:
>>>
>>> On 10/6/16 2:57 PM, Thad Guidry wrote:
 Hello team :)

 So while I'm helping with the Wikidata - Schema.org
 mappings, a request came in to expose subcategories of
 an existing Wikipedia category.

 For example, say I start with this
 topic: https://www.wikidata.org/wiki/Q27119725  Parking
 facilities

 The topic's main category is shown as "Category:Parking
 facilities" and that has links to Wikipedia,
 specifically a Wikipedia category link, and where the
 WP category page has subcategories that I would like to
 expose somehow in whichever way is *easiest* currently
 with our tools, apis, etc.

 Can it all be done in SPARQL against some services that
 already 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-10 Thread Thad Guidry
Kingsley,

use shortcut syntax instead. Also look at how the many examples show doing
tihngs.
http://tinyurl.com/hkv8z7m



On Mon, Oct 10, 2016 at 1:50 PM Kingsley Idehen 
wrote:

> On 10/9/16 1:34 PM, Thad Guidry wrote:
>
> Kingsley,
>
> The mappings are already in Wikidata (we still have a few properties left
> to map, but the classes are done, except for a few in pending.schema.org.
> You can just query them in some fashion such as this:
> http://tinyurl.com/h9vjqd8
>
>
> Thad,
>
> Shouldn't the following query return all Classes participating in an
> 
>  relation? :
>
> SELECT ?s ?relation ?o
> WHERE { ?s 
>  ?o.
> BIND (
>  AS ?relation)
>   }
> LIMIT 100
>
> Query Link:
> https://query.wikidata.org/#%0A%0ASELECT%20%3Fs%20%3Frelation%20%3Fo%0AWHERE%20%7B%20%3Fs%20%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20%3Fo.%20%0A%20%20%20%20%20%20%20%20BIND%20%28%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20AS%20%3Frelation%29%20%0A%20%20%20%20%20%20%7D%20%0ALIMIT%20100%0A
>
> If not, can you formulate something closer to that output which makes
> matters easier should you not have an RDF dump available etc..
>
>
> Kingsley
>
>
> On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen 
> wrote:
>
> On 10/8/16 5:04 PM, Thad Guidry wrote:
>
> Class mappings are almost complete Kingsley. We were trying to get
> Wikidata to the point where it is easy for folks to do trivial queries
> right inside WDQS as part of WD Goals for 2016.
>
>
> Thad,
>
> Here is a post (brought up to date in last day) that demonstrates
> owl:equivalentClass reasoning and inference. Once I have a link to the new
> mappings I will integrate into this demo.
>
> Note, this particular LOD Cloud Cache instance has 30 Billion+ triples
> against which the owl:equivalentClass inference is being applied, at query
> evaluation time.
>
> [1]
> http://kidehen.blogspot.com/2014/02/class-equivalence-based-reasoning.html
>
>
> Kingsley
>
>
> On Sat, Oct 8, 2016, 2:38 PM Kingsley Idehen 
> wrote:
>
> On 10/6/16 2:57 PM, Thad Guidry wrote:
>
> Hello team :)
>
> So while I'm helping with the Wikidata - Schema.org mappings, a request
> came in to expose subcategories of an existing Wikipedia category.
>
> For example, say I start with this topic:
> https://www.wikidata.org/wiki/Q27119725  Parking facilities
>
> The topic's main category is shown as "Category:Parking facilities" and
> that has links to Wikipedia, specifically a Wikipedia category link, and
> where the WP category page has subcategories that I would like to expose
> somehow in whichever way is *easiest* currently with our tools, apis, etc.
>
> Can it all be done in SPARQL against some services that already expose WP
> subcategories given a specific category ?  Or is there an API that does
> this already ?  other tools that might expose WP categories ?
>
> The IDEAL GOAL is to query 'equivalent class' = schema.org/ParkingFacility
> and get back the WP categories *in one shot or query or api call.*
>
> http://schema.org/ParkingFacility
>
>-
>Parking facilities in India
>‎
>- Parking facilities in the United States
>
> 
>‎
>
>
>- Aircraft hangars
>‎
>
>
>- Garages (parking)
>‎
>- Railway depots
>‎
>
>
> Any gurus ?
>
>
> Hi Thad,
>
> If there are owl:equivalentClass mappings in some Linked Data Space, and
> the SPARQL service associated with said Data Space supports
> owl:equivalentClass reasoning, then the answer to your question is yes.
> What unknown right now is the class mappings between Wikidata and
> Schema.org. If a dump of those exist, the rest is trivial :)
>
> --
> Regards,
>
> Kingsley Idehen   
> Founder & CEO
> OpenLink Software   (Home Page: http://www.openlinksw.com)
>
> Weblogs (Blogs):
> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
> Blogspot Blog: http://kidehen.blogspot.com
> Medium Blog: https://medium.com/@kidehen
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
> : 
> 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-10 Thread Kingsley Idehen
On 10/9/16 1:34 PM, Thad Guidry wrote:
> Kingsley,
>
> The mappings are already in Wikidata (we still have a few properties
> left to map, but the classes are done, except for a few in
> pending.schema.org .  You can just query
> them in some fashion such as this: http://tinyurl.com/h9vjqd8

Thad,

Shouldn't the following query return all Classes participating in an
 relation? :

SELECT ?s ?relation ?o
WHERE { ?s  ?o.
BIND ( AS ?relation)
  }
LIMIT 100

Query Link:
https://query.wikidata.org/#%0A%0ASELECT%20%3Fs%20%3Frelation%20%3Fo%0AWHERE%20%7B%20%3Fs%20%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20%3Fo.%20%0A%20%20%20%20%20%20%20%20BIND%20%28%3Chttps%3A%2F%2Fwww.wikidata.org%2Fwiki%2FProperty%3AP1709%3E%20AS%20%3Frelation%29%20%0A%20%20%20%20%20%20%7D%20%0ALIMIT%20100%0A

If not, can you formulate something closer to that output which makes
matters easier should you not have an RDF dump available etc..

Kingsley

>
> On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen
> > wrote:
>
> On 10/8/16 5:04 PM, Thad Guidry wrote:
>>
>> Class mappings are almost complete Kingsley. We were trying to
>> get Wikidata to the point where it is easy for folks to do
>> trivial queries right inside WDQS as part of WD Goals for 2016.
>>
>
> Thad,
>
> Here is a post (brought up to date in last day) that demonstrates
> owl:equivalentClass reasoning and inference. Once I have a link to
> the new mappings I will integrate into this demo.
>
> Note, this particular LOD Cloud Cache instance has 30 Billion+
> triples against which the owl:equivalentClass inference is being
> applied, at query evaluation time.
>
> [1]
> http://kidehen.blogspot.com/2014/02/class-equivalence-based-reasoning.html
>
>
> Kingsley
>>
>> On Sat, Oct 8, 2016, 2:38 PM Kingsley Idehen
>> > wrote:
>>
>> On 10/6/16 2:57 PM, Thad Guidry wrote:
>>> Hello team :)
>>>
>>> So while I'm helping with the Wikidata - Schema.org
>>> mappings, a request came in to expose subcategories of an
>>> existing Wikipedia category.
>>>
>>> For example, say I start with this
>>> topic: https://www.wikidata.org/wiki/Q27119725  Parking
>>> facilities
>>>
>>> The topic's main category is shown as "Category:Parking
>>> facilities" and that has links to Wikipedia, specifically a
>>> Wikipedia category link, and where the WP category page has
>>> subcategories that I would like to expose somehow in
>>> whichever way is *easiest* currently with our tools, apis, etc.
>>>
>>> Can it all be done in SPARQL against some services that
>>> already expose WP subcategories given a specific category ? 
>>> Or is there an API that does this already ?  other tools
>>> that might expose WP categories ?
>>>
>>> The IDEAL GOAL is to query 'equivalent class' =
>>> schema.org/ParkingFacility
>>>  and get back the WP
>>> categories *in one shot or query or api call.*
>>>
>>> http://schema.org/ParkingFacility
>>>
>>>  *
>>>
>>> Parking facilities in India
>>> 
>>> ‎
>>>  *
>>> Parking facilities in the United States
>>> 
>>> ‎
>>>
>>>  *
>>> Aircraft hangars
>>> ‎
>>>
>>>  *
>>> Garages (parking)
>>> ‎
>>>  *
>>> Railway depots
>>> ‎
>>>
>>>
>>> Any gurus ?
>>
>> Hi Thad,
>>
>> If there are owl:equivalentClass mappings in some Linked Data
>> Space, and the SPARQL service associated with said Data Space
>> supports owl:equivalentClass reasoning, then the answer to
>> your question is yes.
>>
>> What unknown right now is the class mappings between Wikidata
>> and Schema.org. If a dump of those exist, the rest is trivial :)
>>
>> -- 
>> Regards,
>>
>> Kingsley Idehen
>> Founder & CEO 
>> OpenLink Software   (Home Page: http://www.openlinksw.com)
>>
>> Weblogs (Blogs):
>> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
>> 
>> Blogspot Blog: http://kidehen.blogspot.com
>>  

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-10 Thread Thad Guidry
Thanks Andrew but I know and see the pitfalls.
The use case is only 1 level deep and to be treated not as a Category but
instead as simply something "Related" or "Relative" to the topic.
Keeping within those 2 constraints from my tests seems to work reasonably
well.  Beyond those constraints... I agree, its the wild west and not
something that we are interested in.


On Mon, Oct 10, 2016 at 5:20 AM Andrew Gray 
wrote:

> Hi Thad,
>
> One quick red flag - I'm not sure how familiar you are with the
> category system, but automatically parsing it without sanity-checking
> can very quickly lead you into a minefield. There are a substantial
> number of category trees which seem reasonable at first, but rapidly
> go in unexpected directions.
>
> For example, if you start at "Category:Road transport" on enwiki and
> go two categories deep, you get "Category:Parking facilities‎" - so
> far, so good - but you also get "Category:The Hitchhiker's Guide to
> the Galaxy", "Category:Songs about buses", and "Category:Cycling
> journalists‎".
>
> There are a few pairs of categories which contain each other directly,
> and a much larger number which contain each other once you go a few
> levels of subcategories deep & so go in endless loops. And, of course,
> a clean category tree in French might be a mess in German, or vice
> versa.
>
> None of this is to say "don't do it", but rather "don't expect it to
> be clean and tidy" :-)
>
> Andrew.
>
> On 7 October 2016 at 02:08, Thad Guidry  wrote:
> > Thanks Stas,
> >
> > So, hmm...we'd have to build our own parser or something is what your
> saying
> > ?
> > Because Wikidata doesn't have those kinds of connections in its graph and
> > also doesn't have a SPARQL service yet against the Wikipedia
> > API:Categorymembers https://www.mediawiki.org/wiki/API:Categorymembers
> to
> > deduce those subcategories, right ?
> >
> > How difficult is it for someone to create a service like the
> LabelService ,
> > but instead using the WP Categorymembers API ?  Or do you have some other
> > ideas ?
> >
> >
> > On Thu, Oct 6, 2016 at 6:10 PM Stas Malyshev 
> > wrote:
> >>
> >> Hi!
> >>
> >> > Can it all be done in SPARQL against some services that already expose
> >> > WP subcategories given a specific category ?  Or is there an API that
> >> > does this already ?  other tools that might expose WP categories ?
> >>
> >> I don't think subcategory relationship is not recorded in Wikidata. E.g.
> >> https://www.wikidata.org/wiki/Q7361750 contains
> >> https://www.wikidata.org/wiki/Q14436424 but neither have any indication
> >> of that.
> >> The problem I guess is that category hierarchy is different on all
> >> wikis, so it's hard to have one property that expresses it on Wikidata.
> >>
> >> You could do through "subclass of" and "category's main topic" but not
> >> sure that'd capture all. E.g.: http://tinyurl.com/h7qpcdn but that only
> >> captures one subcategory, since other items don't have the same
> >> hierarchy in Wikidata.
> >> --
> >> Stas Malyshev
> >> smalys...@wikimedia.org
> >>
> >> ___
> >> Wikidata mailing list
> >> Wikidata@lists.wikimedia.org
> >> https://lists.wikimedia.org/mailman/listinfo/wikidata
> >
> >
> > ___
> > Wikidata mailing list
> > Wikidata@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikidata
> >
>
>
>
> --
> - Andrew Gray
>   andrew.g...@dunelm.org.uk
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-10 Thread Andrew Gray
Hi Thad,

One quick red flag - I'm not sure how familiar you are with the
category system, but automatically parsing it without sanity-checking
can very quickly lead you into a minefield. There are a substantial
number of category trees which seem reasonable at first, but rapidly
go in unexpected directions.

For example, if you start at "Category:Road transport" on enwiki and
go two categories deep, you get "Category:Parking facilities‎" - so
far, so good - but you also get "Category:The Hitchhiker's Guide to
the Galaxy", "Category:Songs about buses", and "Category:Cycling
journalists‎".

There are a few pairs of categories which contain each other directly,
and a much larger number which contain each other once you go a few
levels of subcategories deep & so go in endless loops. And, of course,
a clean category tree in French might be a mess in German, or vice
versa.

None of this is to say "don't do it", but rather "don't expect it to
be clean and tidy" :-)

Andrew.

On 7 October 2016 at 02:08, Thad Guidry  wrote:
> Thanks Stas,
>
> So, hmm...we'd have to build our own parser or something is what your saying
> ?
> Because Wikidata doesn't have those kinds of connections in its graph and
> also doesn't have a SPARQL service yet against the Wikipedia
> API:Categorymembers https://www.mediawiki.org/wiki/API:Categorymembers to
> deduce those subcategories, right ?
>
> How difficult is it for someone to create a service like the LabelService ,
> but instead using the WP Categorymembers API ?  Or do you have some other
> ideas ?
>
>
> On Thu, Oct 6, 2016 at 6:10 PM Stas Malyshev 
> wrote:
>>
>> Hi!
>>
>> > Can it all be done in SPARQL against some services that already expose
>> > WP subcategories given a specific category ?  Or is there an API that
>> > does this already ?  other tools that might expose WP categories ?
>>
>> I don't think subcategory relationship is not recorded in Wikidata. E.g.
>> https://www.wikidata.org/wiki/Q7361750 contains
>> https://www.wikidata.org/wiki/Q14436424 but neither have any indication
>> of that.
>> The problem I guess is that category hierarchy is different on all
>> wikis, so it's hard to have one property that expresses it on Wikidata.
>>
>> You could do through "subclass of" and "category's main topic" but not
>> sure that'd capture all. E.g.: http://tinyurl.com/h7qpcdn but that only
>> captures one subcategory, since other items don't have the same
>> hierarchy in Wikidata.
>> --
>> Stas Malyshev
>> smalys...@wikimedia.org
>>
>> ___
>> Wikidata mailing list
>> Wikidata@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>



-- 
- Andrew Gray
  andrew.g...@dunelm.org.uk

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


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-09 Thread Thad Guidry
Kingsley,

The mappings are already in Wikidata (we still have a few properties left
to map, but the classes are done, except for a few in pending.schema.org.
You can just query them in some fashion such as this:
http://tinyurl.com/h9vjqd8



On Sun, Oct 9, 2016 at 11:09 AM Kingsley Idehen 
wrote:

> On 10/8/16 5:04 PM, Thad Guidry wrote:
>
> Class mappings are almost complete Kingsley. We were trying to get
> Wikidata to the point where it is easy for folks to do trivial queries
> right inside WDQS as part of WD Goals for 2016.
>
>
> Thad,
>
> Here is a post (brought up to date in last day) that demonstrates
> owl:equivalentClass reasoning and inference. Once I have a link to the new
> mappings I will integrate into this demo.
>
> Note, this particular LOD Cloud Cache instance has 30 Billion+ triples
> against which the owl:equivalentClass inference is being applied, at query
> evaluation time.
>
> [1]
> http://kidehen.blogspot.com/2014/02/class-equivalence-based-reasoning.html
>
>
> Kingsley
>
>
> On Sat, Oct 8, 2016, 2:38 PM Kingsley Idehen 
> wrote:
>
> On 10/6/16 2:57 PM, Thad Guidry wrote:
>
> Hello team :)
>
> So while I'm helping with the Wikidata - Schema.org mappings, a request
> came in to expose subcategories of an existing Wikipedia category.
>
> For example, say I start with this topic:
> https://www.wikidata.org/wiki/Q27119725  Parking facilities
>
> The topic's main category is shown as "Category:Parking facilities" and
> that has links to Wikipedia, specifically a Wikipedia category link, and
> where the WP category page has subcategories that I would like to expose
> somehow in whichever way is *easiest* currently with our tools, apis, etc.
>
> Can it all be done in SPARQL against some services that already expose WP
> subcategories given a specific category ?  Or is there an API that does
> this already ?  other tools that might expose WP categories ?
>
> The IDEAL GOAL is to query 'equivalent class' = schema.org/ParkingFacility
> and get back the WP categories *in one shot or query or api call.*
>
> http://schema.org/ParkingFacility
>
>-
>Parking facilities in India
>‎
>- Parking facilities in the United States
>
> 
>‎
>
>
>- Aircraft hangars
>‎
>
>
>- Garages (parking)
>‎
>- Railway depots
>‎
>
>
> Any gurus ?
>
>
> Hi Thad,
>
> If there are owl:equivalentClass mappings in some Linked Data Space, and
> the SPARQL service associated with said Data Space supports
> owl:equivalentClass reasoning, then the answer to your question is yes.
> What unknown right now is the class mappings between Wikidata and
> Schema.org. If a dump of those exist, the rest is trivial :)
>
> --
> Regards,
>
> Kingsley Idehen   
> Founder & CEO
> OpenLink Software   (Home Page: http://www.openlinksw.com)
>
> Weblogs (Blogs):
> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
> Blogspot Blog: http://kidehen.blogspot.com
> Medium Blog: https://medium.com/@kidehen
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
> : 
> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
>
> ___
> Wikidata mailing 
> listWikidata@lists.wikimedia.orghttps://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
>
> --
> Regards,
>
> Kingsley Idehen   
> Founder & CEO
> OpenLink Software   (Home Page: http://www.openlinksw.com)
>
> Weblogs (Blogs):
> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
> Blogspot Blog: http://kidehen.blogspot.com
> Medium Blog: https://medium.com/@kidehen
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
> : 
> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> 

Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-08 Thread Kingsley Idehen
On 10/6/16 2:57 PM, Thad Guidry wrote:
> Hello team :)
>
> So while I'm helping with the Wikidata - Schema.org mappings, a
> request came in to expose subcategories of an existing Wikipedia category.
>
> For example, say I start with this
> topic: https://www.wikidata.org/wiki/Q27119725  Parking facilities
>
> The topic's main category is shown as "Category:Parking facilities"
> and that has links to Wikipedia, specifically a Wikipedia category
> link, and where the WP category page has subcategories that I would
> like to expose somehow in whichever way is *easiest* currently with
> our tools, apis, etc.
>
> Can it all be done in SPARQL against some services that already expose
> WP subcategories given a specific category ?  Or is there an API that
> does this already ?  other tools that might expose WP categories ?
>
> The IDEAL GOAL is to query 'equivalent class' =
> schema.org/ParkingFacility  and get
> back the WP categories *in one shot or query or api call.*
>
> http://schema.org/ParkingFacility
>
>  *
>
> Parking facilities in India
> ‎
>  *
> Parking facilities in the United States
> 
> ‎
>
>  *
> Aircraft hangars
> ‎
>
>  *
> Garages (parking)
> ‎
>  *
> Railway depots
> ‎
>
>
> Any gurus ?

Hi Thad,

If there are owl:equivalentClass mappings in some Linked Data Space, and
the SPARQL service associated with said Data Space supports
owl:equivalentClass reasoning, then the answer to your question is yes.

What unknown right now is the class mappings between Wikidata and
Schema.org. If a dump of those exist, the rest is trivial :)

-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/dataspace/person/kidehen#this
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



smime.p7s
Description: S/MIME Cryptographic Signature
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-07 Thread Gerard Meijssen
Hoi,
Magnus does use subcategories extensively in his tools. It is not WDQS but
it is data. Be warned, many of the "lists" and "categories" in Wikidata are
not only this but are reused for other purposes.
Thanks,
  GerardM

On 6 October 2016 at 20:57, Thad Guidry  wrote:

> Hello team :)
>
> So while I'm helping with the Wikidata - Schema.org mappings, a request
> came in to expose subcategories of an existing Wikipedia category.
>
> For example, say I start with this topic: https://www.wikidata.
> org/wiki/Q27119725  Parking facilities
>
> The topic's main category is shown as "Category:Parking facilities" and
> that has links to Wikipedia, specifically a Wikipedia category link, and
> where the WP category page has subcategories that I would like to expose
> somehow in whichever way is *easiest* currently with our tools, apis, etc.
>
> Can it all be done in SPARQL against some services that already expose WP
> subcategories given a specific category ?  Or is there an API that does
> this already ?  other tools that might expose WP categories ?
>
> The IDEAL GOAL is to query 'equivalent class' = schema.org/ParkingFacility
> and get back the WP categories *in one shot or query or api call.*
>
> http://schema.org/ParkingFacility
>
>-
>Parking facilities in India
>‎
>- Parking facilities in the United States
>
> 
>‎
>
>
>- Aircraft hangars
>‎
>
>
>- Garages (parking)
>‎
>- Railway depots
>‎
>
>
> Any gurus ?
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
>
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-06 Thread Denny Vrandečić
DBpedia has the category data in RDF. The last release of DBpedia also
included Wikidata - it should be possible to query the combined dataset
there.

On Thu, Oct 6, 2016, 19:47 Thad Guidry  wrote:

> Cool.  Yeap, you got the idea now.
>
> OK, We'll stay tuned for a future new Service !
>
> Schema.org and Google and the World thank you Stas :)
>
>
> On Thu, Oct 6, 2016 at 8:39 PM Stas Malyshev 
> wrote:
>
> Hi!
>
> > This is what I was thinking would have already been integrated into
> > Wikidata somehow, somewhere, ideally as a SERVICE to call in SPARQL if
> > there were any Category Labels , maybe another serviceParam for the
> > label Service that could take another serviceParam to retrieve the
> > subcategories ?
>
> Right now, we do not support calls out to external services, due to
> security issues it may produce. However, making limited API to
> specifically mediawiki API may be possible, it's actually an idea we
> haven't considered before and may be possible to do.
> Needs some thinking though, so don't expect it to be done by next week
> :) but interesting, I'll look into it.
>
> We probably will need to use generator since we'd need Wikidata IDs, but
> something like this:
>
>
> /w/api.php?action=query=json=pageprops=categorymembers=wikibase_item=Category%3AParking=ids%7Ctitle=subcat
>
> should work. It needs some code to be able to properly build and consume
> queries, but not impossible.
>
> --
> Stas Malyshev
> smalys...@wikimedia.org
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-06 Thread Stas Malyshev
Hi!

> This is what I was thinking would have already been integrated into
> Wikidata somehow, somewhere, ideally as a SERVICE to call in SPARQL if
> there were any Category Labels , maybe another serviceParam for the
> label Service that could take another serviceParam to retrieve the
> subcategories ?

Right now, we do not support calls out to external services, due to
security issues it may produce. However, making limited API to
specifically mediawiki API may be possible, it's actually an idea we
haven't considered before and may be possible to do.
Needs some thinking though, so don't expect it to be done by next week
:) but interesting, I'll look into it.

We probably will need to use generator since we'd need Wikidata IDs, but
something like this:

/w/api.php?action=query=json=pageprops=categorymembers=wikibase_item=Category%3AParking=ids%7Ctitle=subcat

should work. It needs some code to be able to properly build and consume
queries, but not impossible.

-- 
Stas Malyshev
smalys...@wikimedia.org

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


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-06 Thread Thad Guidry
Thanks Stas,

So, hmm...we'd have to build our own parser or something is what your
saying ?
Because Wikidata doesn't have those kinds of connections in its graph and
also doesn't have a SPARQL service yet against the Wikipedia
API:Categorymembers https://www.mediawiki.org/wiki/API:Categorymembers to
deduce those subcategories, right ?

How difficult is it for someone to create a service like the LabelService ,
but instead using the WP Categorymembers API ?  Or do you have some other
ideas ?


On Thu, Oct 6, 2016 at 6:10 PM Stas Malyshev 
wrote:

> Hi!
>
> > Can it all be done in SPARQL against some services that already expose
> > WP subcategories given a specific category ?  Or is there an API that
> > does this already ?  other tools that might expose WP categories ?
>
> I don't think subcategory relationship is not recorded in Wikidata. E.g.
> https://www.wikidata.org/wiki/Q7361750 contains
> https://www.wikidata.org/wiki/Q14436424 but neither have any indication
> of that.
> The problem I guess is that category hierarchy is different on all
> wikis, so it's hard to have one property that expresses it on Wikidata.
>
> You could do through "subclass of" and "category's main topic" but not
> sure that'd capture all. E.g.: http://tinyurl.com/h7qpcdn but that only
> captures one subcategory, since other items don't have the same
> hierarchy in Wikidata.
> --
> Stas Malyshev
> smalys...@wikimedia.org
>
> ___
> Wikidata mailing list
> Wikidata@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata
>
___
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata


Re: [Wikidata] Help with SPARQL or API or something to get subcategories

2016-10-06 Thread Stas Malyshev
Hi!

> Can it all be done in SPARQL against some services that already expose
> WP subcategories given a specific category ?  Or is there an API that
> does this already ?  other tools that might expose WP categories ?

I don't think subcategory relationship is not recorded in Wikidata. E.g.
https://www.wikidata.org/wiki/Q7361750 contains
https://www.wikidata.org/wiki/Q14436424 but neither have any indication
of that.
The problem I guess is that category hierarchy is different on all
wikis, so it's hard to have one property that expresses it on Wikidata.

You could do through "subclass of" and "category's main topic" but not
sure that'd capture all. E.g.: http://tinyurl.com/h7qpcdn but that only
captures one subcategory, since other items don't have the same
hierarchy in Wikidata.
-- 
Stas Malyshev
smalys...@wikimedia.org

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