title: Is it possible to just extract the SPARQL endpoint from a SPARQL query?
body: <p>I'm learning Semantic Web programming and trying to develop an app for the Android platform. There's a textfield in my app where the user would enter a SPARQL query. </p>
  
  <p>I was wondering if I could just extract the SPARQL endpoint from a whole SPARQL query. For example, in the query <code>SELECT ?class FROM &lt;http://myexample.com&gt; WHERE{?class a owl:Class} Order By ?class</code> I would want to extract the <code>http://myexample.com</code>.</p>
  
  <p>Or from a query that looks like <code>SELECT ?dataType ?data WHERE { &lt;http://nasa.dataincubator.org/launch/1961-012&gt; ?dataType ?data.}</code> , extract the <code>http://nasa.dataincubator.org/launch/1961-012</code>.</p>
  
  <p>I want to use the extracted endpoint and then retrieve the classes, properties, etc. of that ontology from within the SPARQL endpoint.</p>
  
  <p>Is it possible to extract just the endpoint?</p>