Hi Mike, On 02/13/2013 05:48 PM, The Guy wrote:
Thank you Mohamed.Exactly what I needed. Is there any in built limitation? I used: SPARQL: SELECT ?s WHERE {?s a <http://schema.org/Person>}and I got a suspectly low and round number of 50,000 :) . For example Abraham_Lincoln is not in the CSV file I downloaded.
You can still get the results you want by using "LIMIT" and "OFFSET" and increasing the offset value in each subsequent SPARQL query, as follows:
1. SELECT ?s WHERE {?s a <http://schema.org/Book>
<http://schema.org/Book>} LIMIT 1000
2. SELECT ?s WHERE {?s a <http://schema.org/Book>
<http://schema.org/Book>} LIMIT 1000 OFFSET 1000
3. SELECT ?s WHERE {?s a <http://schema.org/Book>
<http://schema.org/Book>} LIMIT 1000 OFFSET 2000
4. and so on
Also, is there any 'magic' statement to get the short abstracts from 'short_abstracts_en.nq' for the 'categories' selected in 'instance_types_en.nt' be it 'Book', 'Place', etc.?
Please, find the attached script. Call it follows: ./short_abstract_extractor.sh books.nt short_abstracts_en.nq > book_short_abstracts.nqwhere books.nt is the output of the previous command, short_abstracts_en.nq is the nq file, book_short_abstracts.nq is the output file of the script.
You can also get the required information using SPARQL as well:
SELECT ?s ?shortAbstract WHERE {?s a <http://schema.org/Book>. ?s
rdfs:comment ?shortAbstract} LIMIT 1000
Hope that helps.
Cheers, M ------------------------------------------------------------------------ *From:* Mohamed Morsey <[email protected]> *To:* The Guy <[email protected]>*Cc:* "[email protected]" <[email protected]>*Sent:* Wednesday, February 13, 2013 6:49:01 AM*Subject:* Re: [Dbpedia-discussion] get only certain data out DBpedia 3.8 DownloadsHi Mike, On 02/13/2013 03:21 PM, The Guy wrote:Hi, I have downloaded certain files for example instance_types_en.nt.I would like to extract specific information for example everything with <http://schema.org/Book> <http://schema.org/Book> or <http://schema.org/Place> <http://schema.org/Place>.I can use Excel but it is time consuming as the files are too big to put them in Excel.Also, I was thinking of processing the files by parsing the strings and save the information required in other file.However, my programming skills are rusty to say the least.Is there a way to get these specific datasets from dbpedia.org or do you know other website that can provide them?You can either use UNIX commands or SPARQL queries against one of the SPARQL endpoints [1, 2], to get the information you are looking for.* UNIX: grep '<http://schema.org/Book> <http://schema.org/Book>' instance_types_en.nt > output.nt where output.nt is the output file. * SPARQL: SELECT ?s WHERE {?s a <http://schema.org/Book> <http://schema.org/Book>} limit 1000Thank you, Mike[1] http://dbpedia.org/sparql [2] http://live.dbpedia.org/sparql -- Kind Regards Mohamed Morsey Department of Computer Science University of Leipzig
-- Kind Regards Mohamed Morsey Department of Computer Science University of Leipzig
short_abstract_extractor.sh
Description: application/shellscript
------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________ Dbpedia-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
