java - How to filter DBpedia results in SPARQL -
i have little problem... if have simple sparql query
select ?abstract { <http://dbpedia.org/resource/mitsubishi> <http://dbpedia.org/ontology/abstract> ?abstract. filter langmatches( lang(?abstract), 'en')}
i have result: sparql result , has non-english character... there idea how remove them , retrieve english words?
you'll need define characters want , don't want in result, can use replace replace characters outside of range with, e.g., empty strings. if wanted exclude basic latin, latin-1 supplement, latin extended-a, , latin extended-b ranges, (which ends being \u0000–\u024f) following:
select ?abstract ?cleanabstract { dbpedia:mitsubishi dbpedia-owl:abstract ?abstract filter langmatches( lang(?abstract), 'en') bind(replace(?abstract,"[^\\x{0000}-\\x{024f}]","") ?cleanabstract) }
or simpler:
select (replace(?abstract_,"[^\\x{0000}-\\x{024f}]","") ?abstract) { dbpedia:mitsubishi dbpedia-owl:abstract ?abstract_ filter langmatches(lang(?abstract_), 'en') }
the mitsubishi group (, mitsubishi gurūpu) (also known mitsubishi group of companies or mitsubishi companies) group of autonomous japanese multinational companies covering range of businesses share mitsubishi brand, trademark, , legacy.the mitsubishi group of companies form loose entity, mitsubishi keiretsu, referenced in japanese , media , official reports; in general these companies descend zaibatsu of same name. top 25 companies members of mitsubishi kin'yōkai, or "friday club", , meet monthly. in addition mitsubishi.com committee exists facilitate communication , access of mitsubishi brand through portal web site.
you may find latin script in unicode wikipedia article useful.
Comments
Post a Comment