I am having a hard time creating a regular expression that extracts the namespaces from this SPARQL query:
SELECT *
WHERE {
?Vehicle rdf:type umbel-sc:CompactCar ;
skos:subject <http://dbpedia.org/resource/Category:Vehicles_with_CVT_transmission>;
dbp-prop:assembly ?Place.
?Place geo-ont:parentFeature dbpedia:United_States .
}
I need to get:
"rdf", "umbel-sc", "skos", "dbp-prop", "geo-ont", "dbpedia"
I need a expression like this:
\\s+([^\\:]*):[^\\s]+
But the above one does not work, because it also eats spaces before reaching :
. What am I doing wrong?