FCT returns unintuitive type/property counts


#1

I have this list of 5 individuals:

FCT query
<query timeout="15010"><text property="http://www.w3.org/2000/01/rdf-schema#label">Star Wars</text><class iri="http://dbpedia.org/class/yago/Movie106613686"/><property iri="http://purl.org/dc/terms/subject"></property><property iri="http://dbpedia.org/ontology/starring"></property><property iri="http://dbpedia.org/ontology/director"></property><view limit="30" type="list" offset="0"></view></query>

SPARQL query from FCT
select distinct ?s1 as ?c1 ?g where { quad map virtrdf:DefaultQuadMap { graph ?g { ?s1 <http://www.w3.org/2000/01/rdf-schema#label> ?o1 . ?o1 bif:contains '(STAR AND WARS)' . }} ?s1 a <http://dbpedia.org/class/yago/Movie106613686> . quad map virtrdf:DefaultQuadMap { ?s1 <http://purl.org/dc/terms/subject> ?s2 . } optional { graph virtrdf:IRI_Rank_c { ?s1 virtrdf:IRI_Rank_rnk_c_int ?srank1 . } } quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/starring> ?s3 . } optional { graph virtrdf:IRI_Rank_c { ?s1 virtrdf:IRI_Rank_rnk_c_int ?srank1 . } } quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/director> ?s4 . } optional { graph virtrdf:IRI_Rank_c { ?s1 virtrdf:IRI_Rank_rnk_c_int ?srank1 . } } } order by desc (?srank1) limit 30 offset 0

I now ask for the classes of those individuals (by changing the type attr on view element to ‘classes’ rather than ‘list’, all else remains the same:

FCT query
<query timeout="15010"><text property="http://www.w3.org/2000/01/rdf-schema#label">Star Wars</text><class iri="http://dbpedia.org/class/yago/Movie106613686"/><property iri="http://purl.org/dc/terms/subject"></property><property iri="http://dbpedia.org/ontology/starring"></property><property iri="http://dbpedia.org/ontology/director"></property><view limit="30" type="classes" offset="0"></view></query>

SPARQL query from FCT
select ?s1c as ?c1 count (*) as ?c2 where { quad map virtrdf:DefaultQuadMap { graph ?g { ?s1 <http://www.w3.org/2000/01/rdf-schema#label> ?o1 . ?o1 bif:contains '(STAR AND WARS)' . }} ?s1 a <http://dbpedia.org/class/yago/Movie106613686> . quad map virtrdf:DefaultQuadMap { ?s1 <http://purl.org/dc/terms/subject> ?s2 . } quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/starring> ?s3 . } quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/director> ?s4 . } ?s1 a ?s1c . } group by ?s1c order by desc 2 limit 30 offset 0

Note the wildcard in the count function for the classes query. We would prefer the wildcard be replaced with distinct ?s1. User does not need whatever * is counting, instead, user needs the number of instances of each class. Can you please make this change, so that the number badges on this list makes sense? Ditto for properties count, user needs the number of objects of each property, not whatever * is counting, i.e. replace wildcard with distinct ?s1o.

@kidehen @hwilliams


#2

This is a little confusing. Please share the permalink of the FCT page in question, or the page collection sequence progression leading the problem via individual permalinks.

Then I or others can just click to see what you mean.


#3

So I assume you seek:

select ?s1p as ?c1 count (distinct ?s1) as ?c2  
where  
	{ quad map virtrdf:DefaultQuadMap 
		{ graph ?g 
			{  ?s1 <http://www.w3.org/2000/01/rdf-schema#label> ?o1 . ?o1 bif:contains  '(STAR AND WARS)'  . }
		} 
	 ?s1 a <http://dbpedia.org/class/yago/Movie106613686> .  
	 
	 quad map virtrdf:DefaultQuadMap 
	 	{ ?s1 <http://purl.org/dc/terms/subject> ?s2 . } 
	quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/starring> ?s3 . } 
	quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/director> ?s4 . } 
	
	?s1 ?s1p ?s1o . 
  } 
group by ?s1p order by desc 2 limit 30  offset 0

rather than

select ?s1p as ?c1 count (*) as ?c2  
where  
	{ quad map virtrdf:DefaultQuadMap 
		{ graph ?g 
			{  ?s1 <http://www.w3.org/2000/01/rdf-schema#label> ?o1 . ?o1 bif:contains  '(STAR AND WARS)'  . }
		} 
	 ?s1 a <http://dbpedia.org/class/yago/Movie106613686> .  
	 
	 quad map virtrdf:DefaultQuadMap 
	 	{ ?s1 <http://purl.org/dc/terms/subject> ?s2 . } 
	quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/starring> ?s3 . } 
	quad map virtrdf:DefaultQuadMap { ?s1 <http://dbpedia.org/ontology/director> ?s4 . } 
	
	?s1 ?s1p ?s1o . 
  } 
group by ?s1p order by desc 2 limit 30  offset 0

/cc @hwilliams @pvk @imitko


#4

FCT permalinks in route, waiting for LOD server to reboot.


#5

So I assume you seek:

Yes, exactly. And the same for property and property-of query too.


#6

Just change the host from lod.openlinksw.com to dbpedia.org in your SPARQL or FCT URI, and you should be fine. LOD has more data, but DBpedia is ample for diagnosing issues. It should also be the default rather than LOD (which is suffering from issues that we are working on etc…).

/cc @hwilliams


#7

Ah, thank you for the info, I will make the changes…


#8

Okay, that’s enough for it to be looked into.

/cc @PvK @imitko


#9

Okay thanks. And actually the vars to count are these:

select ?s1p count (distinct ?s1o)
select ?s1ip count (distinct ?s1) - not ?s1o
select ?s1c count (distinct ?s1)

#10

Just change the host from lod.openlinksw.com to dbpedia.org in your SPARQL or FCT URI

FYI, the VIOS PoC UI now defaults to DBPedia:

image

-sherman