query: SELECT
  (?film as ?item)
  (group_concat(DISTINCT concat("\u007B\u007BP\u007C",strafter(str(?property),"/entity/"),"\u007D\u007D");separator="<br>") as ?part) 
  (SAMPLE(?role) as ?role)
  (MIN(?year) as ?year)
  (SAMPLE(?sitelinks) as ?sitelinks)
  (SAMPLE(?statements) as ?statements)
  (COUNT(DISTINCT ?cast) as ?castlisted)
  (COUNT(DISTINCT ?va) as ?valisted)
  (COUNT(DISTINCT ?propertyxid) as ?ids)
  (CONCAT("<span class='plainlinks'>[", str(sample(?article)), " ar]</span>") as ?en)
  {
    	hint:Query hint:optimizer "None" .
    	?film ?wdt wd:Q133313 .
    	?property wikibase:directClaim ?wdt ; wikibase:claim ?p ; wikibase:statementProperty ?ps
    	OPTIONAL { ?film ?p ?statement . ?statement ?ps wd:Q133313 . ?statement pq:P453 ?role . OPTIONAL { ?role wdt:P31 ?roleinstance } }
    	OPTIONAL { ?film wdt:P577 ?pub BIND(YEAR(?pub) as ?year) }
    	?film wdt:P31/wdt:P279* wd:Q11424
    	OPTIONAL { ?film wikibase:sitelinks ?sitelinks }
    	OPTIONAL { ?film wikibase:statements ?statements }
    	OPTIONAL { ?film wdt:P161 ?cast } .
    	OPTIONAL { ?film wdt:P725 ?va } .
  OPTIONAL { ?film ?wdtxid ?id . ?propertyxid wikibase:directClaim ?wdtxid . ?propertyxid wikibase:propertyType wikibase:ExternalId }
  OPTIONAL { ?article schema:about ?film ; schema:isPartOf <https://ar.wikipedia.org/> }      
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ar" . ?property rdfs:label ?propertylabel }
  }
  GROUP BY ?film
  ORDER BY DESC(?year) ?film