I don't "do" RDF/XML :-) but this may achieve what you want.
PREFIX ....
DESCRIBE ?x { ?x IFC2X3_subset:hasName IFC2X3_subset:IfcBeam }
The default for DESCRIBE is the bNode closure.
If you know the structure, then you can use CONSTRUCT or extract into
variables with SELECT.
Andy
On 26/06/12 18:14, Lewis John Mcgibbney wrote:
Hi Everyone,
Having produced a subset of a rather large ontology I'm now attempting
to write a SPARQL query to retrieve all attributes of any given
individuals if the name matches. An example of one of my
NamedIndividuals is below
<!--
http://www.buildingsmart-tech.org/ifcXML/IFC2x3/FINAL/IFC2X3_subset.owl#IfcBeam
-->
<NamedIndividual rdf:about="&IFC2X3_subset;IfcBeam">
<rdf:type>
<Restriction>
<onProperty
rdf:resource="&IFC2X3_subset;hasSubstitutionGroup"/>
<allValuesFrom
rdf:resource="&IFC2X3_subset;IfcBuildingElement"/>
</Restriction>
</rdf:type>
<rdf:type>
<Restriction>
<onProperty rdf:resource="&IFC2X3_subset;hasNillableValue"/>
<allValuesFrom rdf:resource="&xsd;boolean"/>
</Restriction>
</rdf:type>
<IFC2X3_subset:hasComplexTypeName
rdf:datatype="&xsd;Name">IfcBeam</IFC2X3_subset:hasComplexTypeName>
<IFC2X3_subset:hasExtensionBase
rdf:datatype="&rdfs;Literal">ifc:IfcBuildingElement</IFC2X3_subset:hasExtensionBase>
<IFC2X3_subset:hasNillableValue
rdf:datatype="&xsd;boolean">true</IFC2X3_subset:hasNillableValue>
<IFC2X3_subset:hasName rdf:resource="&IFC2X3_subset;IfcBeam"/>
<IFC2X3_subset:isOfType rdf:resource="&IFC2X3_subset;IfcBeam"/>
</NamedIndividual>
Now say my query matched the rdf:About="" and the
IFC2X3_subset:hasName rdf:resource="&IFC2X3_subset;IfcBeam" out of
all of the individuals I have persisted, I would like all the
information above to be returned within the response...
Any help would be greatly appreciated.
Thank you very much in advance
Lewis