Thanks for the explanation Dimitri. 
My use case is to retrieve as many audio files as possible. The revised 
solution is:

SELECT * WHERE
{  
  ?dbpediaId a dbo:Sound  .
  { ?dbpediaId dbo:fileURL ?fileURL } UNION
  { ?dbpediaId dcterm:format ?format FILTER (regex(str(?format), 
'x-midi|ogg'))} UNION
  { ?dbpediaId dbo:fileExtension ?extension FILTER (regex(str(?extension), 
'(mid|wav)')) } UNION
  { ?dbpediaId dbo:filename ?filename FILTER (regex(str(?filename), 
'.*\\\\.(ogg|WebM|mp3|wav|oga|m4a|flac)$')) }
 }

Which returns ~ 12 000 file names.

> On May 5, 2016, at 12:15 AM, Dimitris Kontokostas <jimk...@gmail.com> wrote:
> 
> Hi Joakim,
> 
> yes indeed contents inside () are stripped in some cases
> http://mappings.dbpedia.org/server/extraction/en/extract?title=Korn&revid=&format=trix&extractors=custom
>  
> <http://mappings.dbpedia.org/server/extraction/en/extract?title=Korn&revid=&format=trix&extractors=custom>
> 
> these triples come from different extractors and that is why there is a 
> difference
> the triples with dbp:filename come from the raw infobox extractor that is 
> known to be of low quality while 
> the dbo:filename triples come from the mappings extractor that provides 
> better quality data so in general you should use the latter
> 
> The problem here is that the mappings extractor is used to map facts for the 
> article while the {{listen}} template is most of the times only related to 
> the article
> so, if there is no other mapped template in the page the page is mapped as 
> Sound and when there are multiple templates we end up with many
> Korn__1 ...
> Korn__2 ...
> Korn__3 ...
> Korn__4 ...
> ...
> 
> Since you obviously have a use case maybe you can tell us how it would be 
> most convenient to provide such facts
> 
> options 
> a) continue as we do now
> 
> b) for every listen template we create a new simple trlple like
> <article_name> dbo:audioFile "filename.ogg"
> 
> c) something more advanced that captures other metadata from the audio file
> https://en.wikipedia.org/wiki/Template:Listen 
> <https://en.wikipedia.org/wiki/Template:Listen>
> 
> Cheers,
> Dimitris
> 
> 
> On Thu, May 5, 2016 at 12:22 AM, Joakim Soderberg 
> <joakim.soderb...@blippar.com <mailto:joakim.soderb...@blippar.com>> wrote:
> Hi,
> I am extracting audio files for “Things” but I came across erroneous 
> filenames for some entries.
> Fore example:
> 
> SELECT ?audio WHERE  {
>    dbr:Korn dbp:filename ?audio
> }
> 
> Returns:        Korn - Predictable .ogg
> But the correct filename is: Korn - Predictable (demo).ogg
> 
> After some investigation I found that
> 
> SELECT ?audio WHERE
>  {
>    dbr:Korn__1 dbo:filename ?audio
> }
> 
> returns the right filename. Is this a bug or a feature? What is the 
> recommended way to extract audio files?
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z 
> <https://ad.doubleclick.net/ddm/clk/302982198;130105516;z>
> _______________________________________________
> Dbpedia-discussion mailing list
> Dbpedia-discussion@lists.sourceforge.net 
> <mailto:Dbpedia-discussion@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion 
> <https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion>
> 
> 
> 
> -- 
> Kontokostas Dimitris

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to