Skip to content

Instantly share code, notes, and snippets.

@edsu
Created August 12, 2013 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/6214277 to your computer and use it in GitHub Desktop.
Save edsu/6214277 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# pass this script a filename of ntriples data and get back a
# little report about the types of resources in the rdf, e.g.
#
# ed@curry:~/$ rdfsum oreily_catalog.nt
# 6803 <http://purl.org/goodrelations/v1#TypeAndQuantityNode>
# 5861 <http://purl.org/goodrelations/v1#Offering>
# 4564 <http://purl.org/goodrelations/v1#UnitPriceSpecification>
# 4065 <http://vocab.org/frbr/core#Manifestation>
# 2100 <http://vocab.org/frbr/core#Expression>
# 2023 <http://xmlns.com/foaf/0.1/Person>
#
grep 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' $1 \
| cut -f 3 -d " " \
| sort \
| uniq -c \
| sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment