From: Rob V. <rv...@do...> - 2012-11-27 00:01:49
|
Hi Jostinah As I suggested in a previous email you really need to go learn SPARQL yourself using a good book/tutorial as previously recommended. We don't know your data nor the questions you want to ask nor do we have the time or inclination to do this for you (especially since you already admitted this is a student project). I'm not sure if I understand what you mean by the value of the Node? Do you have textual labels associated with your diseases? Perhaps with the rdfs:label property? In this case you must have other triples defining these so you would need to add additional pattern(s) to your query to access the nodes of the graph with the textual label. It sounds like you don't have the RDF model completely straight in your head, if you don't understand that fully you will struggle to write SPARQL queries against your data. Rob From: Jostinah Lam <89...@gm...> Reply-To: dotNetRDF User Help and Support <dot...@li...> Date: Tuesday, November 20, 2012 1:59 PM To: <dot...@li...> Subject: [dotNetRDF-Support] SPARQL > Hello dotnetrdf, > > I have already create an owl file and i'm planning to integrate the owl file > into C#. i use the code below: > ////////////////////////////////////////////////////////////////////////////// > ////////////////////////////////////////////////////////////////// > IGraph g = new Graph(); > g.LoadFromFile("exData\\PregnancyInducedHypertension.owl"); > try > { > Object results = g.ExecuteQuery("SELECT ?NamedDisease WHERE { > ?s a ?NamedDisease}"); > if (results is SparqlResultSet) > { > //SELECT/ASK queries give a SparqlResultSet > SparqlResultSet rset = (SparqlResultSet)results; > foreach (SparqlResult r in rset) > { > textBox1.Text += r.ToString() + "\r\n"; > } > } > else if (results is IGraph) > { > //CONSTRUCT/DESCRIBE queries give a IGraph > IGraph resGraph = (IGraph)results; > foreach (Triple t in resGraph.Triples) > { > textBox1.Text += t.ToString() + "\r\n"; > } > } > ////////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////// > > When i query the owl file,i only get this result: > > ?NamedDisease = http://www.w3.org/2002/07/owl#Ontology > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty > ?NamedDisease = http://www.w3.org/2002/07/owl#ObjectProperty........... > ////////////////////////////////////////////////////////////////////////////// > ////////////////// > > What i want from the result is the value of the node.not address like that.how > can i do that? > When i change the a into rdf:type, it show error "The Namespace URI for the > given Prefix 'rdf' is not known by the in-scope NamespaceMapper" > I have already read the answer in Q&A,but i cannot understand what does it > mean. > Do i still have to use prefix as such PREFIX > rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> > > Thanks. > Jostinah > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single web > console. Get in-depth insight into apps, servers, databases, vmware, SAP, > cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from > $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov__________________________________________ > _____ dotNetRDF-Support mailing list dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |