This post will show how to use describe queries from the stardog CLI but the query is not database specific. You can actually export the triples in different formats:
You can also return ALL object graphs of a specific type. This will wrap all descriptions in a rdf:RDF tag.
- NTRIPLES
- RDFXML
- TURTLE
- TRIG
- TRIX
- N3
- NQUADS
$ ./stardog query -c http://localhost:5822/nxp -q "DESCRIBE <http://data.nxp.com/basicTypes/PH3330L>" -f RDFXML
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:nxp="http://purl.org/nxp/schema/v1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="http://data.nxp.com/basicTypes/PH3330L"> <rdf:type rdf:resource="http://purl.org/nxp/schema/v1/BasicType"/> <nxp:productStatusDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-10-28</nxp:productStatusDate> <skos:prefLabel xml:lang="en-us">N-channel TrenchMOS logic level FET</skos:prefLabel> <nxp:productStatus rdf:resource="http://purl.org/nxp/schema/v1/endOfLife"/> <foaf:homepage rdf:resource="http://www.nxp.com/pip/PH3330L"/> <nxp:typeNumber>PH3330L</nxp:typeNumber> <nxp:mechanicalOutline rdf:resource="http://data.nxp.com/packageOutlineVersion/SOT669"/> </rdf:Description> </rdf:RDF>
$ ./stardog query -c http://localhost:5822/nxp -q "DESCRIBE <http://data.nxp.com/basicTypes/PH3330L>" -f TURTLE
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix nxp: <http://purl.org/nxp/schema/v1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://data.nxp.com/basicTypes/PH3330L> a nxp:BasicType ;
nxp:productStatusDate "2011-10-28"^^xsd:date ;
skos:prefLabel "N-channel TrenchMOS logic level FET"@en-us ;
nxp:productStatus nxp:endOfLife ;
foaf:homepage <http://www.nxp.com/pip/PH3330L> ;
nxp:typeNumber "PH3330L" ;
nxp:mechanicalOutline <http://data.nxp.com/packageOutlineVersion/SOT669> .
You can also return ALL object graphs of a specific type. This will wrap all descriptions in a rdf:RDF tag.
./stardog query -c http://localhost:5822/nxp -f RDFXML -q "
PREFIX nxp: <http://purl.org/nxp/schema/v1/>
DESCRIBE ?s
WHERE {
?s a nxp:BasicType.
}
"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:nxp="http://purl.org/nxp/schema/v1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://data.nxp.com/basicTypes/74AUP1G57GW">
<rdf:type rdf:resource="http://purl.org/nxp/schema/v1/BasicType"/>
<nxp:productStatusDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-10-20</nxp:productStatusDate>
...
</rdf:Description>
<rdf:Description rdf:about="http://data.nxp.com/basicTypes/74AUP1G58GW">
<rdf:type rdf:resource="http://purl.org/nxp/schema/v1/BasicType"/>
<nxp:productStatusDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-10-14</nxp:productStatusDate>
...
</rdf:Description>
</rdf:RDF>
No comments:
Post a Comment