├── bin ├── df-SPARQLQuery.py ├── df-clear-triple-store.sh ├── df-conneg-heads.sh ├── df-core.py ├── df-epoch-metadata.py ├── df-epoch.sh ├── df-find.sh ├── df-list-faqts.py ├── df-load-triple-store.sh ├── df-mirror-endpoint.sh ├── df-mirror-endpoint.sh.rq ├── df-named-graphs.py ├── df-publish-epoch-via-cr.sh ├── df-purge-epochs.sh ├── df-purge-orphaned-epochs.sh ├── df-situate-paths.sh ├── df-vars.sh ├── get-binding.xsl ├── install-datafaqs-dependencies.sh ├── randomize-line-order.py ├── readme.md ├── stub-ontology-exemplars.py └── void-triples.sh ├── doc ├── DataFAQs-framework.png ├── DataFAQs-shadow.png ├── DataFAQs.png ├── ckan │ ├── ckan_logo_box.png │ ├── lodcloud │ │ ├── lodcloud-hypermap.pdf │ │ ├── lodcloud-hypermap.png │ │ └── vocab │ │ │ └── ckan-lodcloud-rdf-vocabulary.png │ └── tutorial │ │ ├── add-dataset-resources.png │ │ ├── add-dataset.png │ │ ├── dataset-added.png │ │ ├── resource-metadata.png │ │ ├── submit-dataset-title.png │ │ ├── title-dataset.png │ │ └── your-api-key-is.png ├── diagrams │ ├── SplitNVC.pdf │ └── SplitNVC.png ├── examples │ ├── csv2rdf4lod-enhanced-samples-on-instance-hub │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── default │ │ └── faqt-brick │ │ │ ├── datafaqs-source-me.sh │ │ │ └── epoch.ttl │ ├── iogds-datadumps │ │ └── epoch.ttl │ ├── lod-helpme │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lod-tag-with-contact-emails │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lodcloud-50-tags │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lodcloud-drug-molecules │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lodcloud-group-tags │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lodcloud-lifesciences │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── lodstat-1-good-1-bad │ │ └── faqt-brick │ │ │ └── epoch.ttl │ ├── named-graph-attribution │ │ └── epoch.ttl │ └── quick-lodcloud-group │ │ └── faqt-brick │ │ └── epoch.ttl ├── faqt-brick │ ├── faqt-brick-dimensions.png │ ├── faqt-brick-directory-convention.graffle │ ├── faqt-brick-directory-convention.graffle.pdf │ ├── faqt-brick-epoch-dataset-description.png │ ├── faqt-brick-epoch-evaluation.png │ ├── faqt-brick-epoch-faqt-description.png │ └── faqt-brick-epoch.png ├── insights │ └── lodcloud │ │ └── datasets-with-multiple-topic-tags.ttl ├── lodspeakr │ ├── lodspeakr.png │ └── lodspeakr_4.png ├── papers │ ├── lebo2012ipaw.pdf │ └── mccusker2012ipaw.pdf ├── presentations │ ├── 2012.03.07_lebo-datafaqs-twed.ppt.pdf │ ├── 2012.04.25_lebo-datafaqs-issues.ppt.pdf │ ├── 2012.06.20_lebo-ipaw.ppt.pdf │ └── 2012.06.20_mccusker-ipaw.ppt.pdf └── sadi │ ├── sadi-generate-service-run-config-missing.png │ └── sadi-header.png ├── lib ├── RDFAlerts.war ├── RDFAlerts.war.prov.ttl ├── sadi-services.jar └── sadi.python │ ├── readme.md │ ├── sadi-0.1.5-py2.6.egg │ └── sadi-0.1.5-py2.7.egg ├── ontology ├── between-the-edges.owl ├── between-the-edges.owl.ttl ├── datafaqs.ttl ├── datafaqs.ttl.nt ├── datafaqs.ttl.owl ├── mirror-ontology.htaccess ├── mirror-ontology.sh └── resolves-to-incorrect-content-type.ttl ├── readme.md ├── services ├── sadi │ ├── all.rdf │ ├── all.ttl │ ├── bibo │ │ ├── subject-broader-materials │ │ │ └── sample-inputs │ │ │ │ └── ieeevis-tw-rpi-edu-lam-2012-evaluations-2-categories-2013-Mar-20.ttl │ │ └── subject-broader.py │ ├── ckan │ │ ├── add-metadata-materials │ │ │ └── sample-inputs │ │ │ │ ├── arrayexpress-e-afmx-1.ttl │ │ │ │ ├── arrayexpress_e-afmx-4.ttl │ │ │ │ ├── congresspeople-tagged-government.ttl │ │ │ │ ├── farmers-markets-geographic-data-united-states-tagged-with-geographic.ttl │ │ │ │ ├── food-recalls.ttl │ │ │ │ ├── healthdata-tw-rpi-edu-cr-linksets-2013-Jan-08-small.ttl │ │ │ │ ├── ieeevis-tw-rpi-edu__from-deref.rdf │ │ │ │ ├── twc-healthdata.ttl │ │ │ │ └── white-house-visitor-access-records-tagged-government.ttl │ │ ├── add-metadata.py │ │ ├── lift-ckan-materials │ │ │ ├── GoLD-farmers-market.ttl │ │ │ └── sample-inputs │ │ │ │ ├── any-ckan-instance.ttl │ │ │ │ ├── any-ckan-instance.ttl.out │ │ │ │ ├── elviajero.rdf │ │ │ │ ├── elviajero.rdf.out │ │ │ │ ├── opencalais-neighborhood.ttl │ │ │ │ ├── opencalais-neighborhood.ttl.out │ │ │ │ ├── twc-healthdata.ttl │ │ │ │ ├── twc-healthdata.ttl.out │ │ │ │ ├── two.out │ │ │ │ └── two.ttl │ │ └── lift-ckan.py │ ├── contextual-inverse-functional │ │ ├── contextual-inverse-functional.py │ │ └── sample-inputs │ │ │ └── myPa.ttl │ ├── core │ │ ├── augment-datasets │ │ │ ├── by-reference │ │ │ │ ├── with-rdf-extension-materials │ │ │ │ │ └── sample-inputs │ │ │ │ │ │ ├── hub-healthdata-gov.ttl │ │ │ │ │ │ └── hub-healthdata-gov.ttl.out │ │ │ │ └── with-rdf-extension.py │ │ │ ├── sameas-org-materials │ │ │ │ ├── sameas-org-datafaqs.rdf │ │ │ │ ├── sameas-org-datafaqs.ttl │ │ │ │ └── sample-inputs │ │ │ │ │ └── edinburgh.ttl │ │ │ ├── sameas-org.py │ │ │ ├── with-preferred-uri-and-ckan-meta-void-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── datafaqs-3-now-dcat.ttl │ │ │ │ │ ├── datafaqs-3.ttl │ │ │ │ │ └── datafaqs-3.ttl.out │ │ │ └── with-preferred-uri-and-ckan-meta-void.py │ │ ├── select-datasets │ │ │ ├── by-ckan-group-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── datahubio-datafaqs.ttl │ │ │ │ │ └── datahubio-lodcloud.ttl │ │ │ ├── by-ckan-group.py │ │ │ ├── by-ckan-installation-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── healthdata-gov.ttl │ │ │ │ │ ├── healthdata-gov.ttl.out │ │ │ │ │ ├── healthdata-tw-rpi-edu.ttl │ │ │ │ │ └── healthdata-tw-rpi-edu.ttl.out │ │ │ ├── by-ckan-installation.py │ │ │ ├── by-ckan-tag-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── ckan-lifesciences.ttl │ │ │ │ │ ├── ckan-lod-helpme.ttl │ │ │ │ │ ├── ckan-lod.ttl │ │ │ │ │ ├── ckan-lod.ttl.out │ │ │ │ │ ├── ckan-provenance-metadata.ttl │ │ │ │ │ └── ckan-provenance-metadata.ttl.out │ │ │ ├── by-ckan-tag.py │ │ │ ├── by-ckan-tag.ttl │ │ │ ├── identity-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── drug-molecules-with-datahub.rq │ │ │ │ │ ├── drug-molecules.rq │ │ │ │ │ ├── drug-molecules.sh │ │ │ │ │ ├── drug-molecules.ttl │ │ │ │ │ ├── drug-molecules.ttl.out │ │ │ │ │ ├── iogds-2012-Mar-09.ttl │ │ │ │ │ ├── lodcloud-random-50.ttl │ │ │ │ │ └── logd.ttl │ │ │ ├── identity.py │ │ │ ├── via-sparql-query-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── conversion_AbstractDatasets.rq │ │ │ │ │ ├── conversion_AbstractDatasets.ttl │ │ │ │ │ ├── csv2rdf4lod-dataset-samples-in-endpoint.rq │ │ │ │ │ ├── csv2rdf4lod-dataset-samples-in-endpoint.ttl │ │ │ │ │ ├── logd-converted-datasets-with-samples.rq │ │ │ │ │ ├── logd-converted-datasets-with-samples.ttl │ │ │ │ │ └── logd-converted-datasets-with-samples.ttl.out │ │ │ └── via-sparql-query.py │ │ └── select-faqts │ │ │ ├── identity-materials │ │ │ └── sample-inputs │ │ │ │ ├── max-1-topic-tag.ttl │ │ │ │ ├── redirect-loop.ttl │ │ │ │ └── void-triples.ttl │ │ │ ├── identity.py │ │ │ ├── identity0-materials │ │ │ └── sample-inputs │ │ │ │ └── named-graphs-a-mygrid.ttl │ │ │ ├── identity0.py │ │ │ ├── towards │ │ │ ├── ckan-group-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── ckan-lodcloud.ttl │ │ │ └── ckan-group.py │ │ │ ├── via-sparql-query-materials │ │ │ └── sample-inputs │ │ │ │ ├── from-official-sadi-registry.rq │ │ │ │ └── from-official-sadi-registry.ttl │ │ │ ├── via-sparql-query.py │ │ │ ├── via-sparql-query.ttl │ │ │ ├── visko-planner-materials │ │ │ └── sample-inputs │ │ │ │ └── manylines.ttl │ │ │ └── visko-planner.py │ ├── faqt-template.py │ ├── faqt │ │ ├── access │ │ │ ├── in-sparql-endpoint-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── 1-good-1-bad-from-lodstat.ttl │ │ │ │ │ ├── 2000-us-census-rdf.rdf │ │ │ │ │ └── fu-berlin-stitch.rdf │ │ │ ├── in-sparql-endpoint.py │ │ │ ├── in-sparql-endpoint.ttl │ │ │ ├── lena-example-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── chebi-endpoint.ttl │ │ │ ├── lena-example.py │ │ │ ├── lena-example.ttl │ │ │ ├── void-datadump-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── iogds.ttl │ │ │ │ │ └── iogds.ttl.out │ │ │ ├── void-datadump.py │ │ │ └── void-subset-tree-dumps │ │ │ │ ├── .gitignore │ │ │ │ ├── README.txt │ │ │ │ ├── pom.xml │ │ │ │ ├── sample-inputs │ │ │ │ └── post.ttl │ │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── tw │ │ │ │ │ └── rpi │ │ │ │ │ └── edu │ │ │ │ │ └── datafaqs │ │ │ │ │ └── treedumps │ │ │ │ │ ├── DumpResource.java │ │ │ │ │ └── TreeDumpsRippleService.java │ │ │ │ └── start.sh │ │ ├── completeness-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── completeness.py │ │ ├── completeness.ttl │ │ ├── connected │ │ │ ├── nquad-graph-materials │ │ │ │ └── prototype-1 │ │ │ │ │ ├── g0.ttl │ │ │ │ │ ├── g0.ttl.sd_name │ │ │ │ │ ├── g1.ttl │ │ │ │ │ ├── g1.ttl.sd_name │ │ │ │ │ ├── g2.ttl │ │ │ │ │ └── g2.ttl.sd_name │ │ │ ├── references-instance-hub-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── tobacco.ttl │ │ │ ├── references-instance-hub.py │ │ │ ├── references-instance-hub.ttl │ │ │ ├── void-linkset-materials │ │ │ │ ├── linkset.rq │ │ │ │ └── sample-inputs │ │ │ │ │ ├── farmers-markets-ckan-gold.ttl │ │ │ │ │ └── farmers-markets-new-crap.ttl │ │ │ └── void-linkset.py │ │ ├── consistensy-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── consistensy.py │ │ ├── datascape │ │ │ ├── size-deprecated.py │ │ │ ├── size-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── 1000.out │ │ │ │ │ └── 1000.ttl │ │ │ └── size.py │ │ ├── discuss │ │ │ ├── contributor-email-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── ckan-aemet.ttl │ │ │ │ │ └── ckan-aemet.ttl.out │ │ │ ├── contributor-email.py │ │ │ ├── contributor-email.ttl │ │ │ └── via-hypermail │ │ │ │ ├── groups-materials │ │ │ │ ├── sample-html │ │ │ │ │ └── lists-w3-org-public.html │ │ │ │ └── sample-inputs │ │ │ │ │ ├── w3-org.ttl │ │ │ │ │ └── w3-org.ttl.out │ │ │ │ ├── groups.py │ │ │ │ ├── message-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── public-prov-wg-2011-apr-0000.ttl │ │ │ │ │ ├── public-prov-wg-2011-apr-0000.ttl.out │ │ │ │ │ ├── public-prov-wg-2011-aug-0000.ttl │ │ │ │ │ ├── public-prov-wg-2011-aug-0000.ttl.out │ │ │ │ │ ├── public-prov-wg-2011-aug-0014.ttl │ │ │ │ │ ├── public-prov-wg-2011-aug-0014.ttl.out │ │ │ │ │ ├── public-prov-wg-2011-aug-0049.ttl │ │ │ │ │ ├── public-prov-wg-2011-aug-0049.ttl.out │ │ │ │ │ ├── public-prov-wg.ttl │ │ │ │ │ └── public-prov-wg.ttl.out │ │ │ │ ├── message.py │ │ │ │ ├── per-group-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── pso-pc.ttl │ │ │ │ │ ├── public-lod.ttl │ │ │ │ │ ├── public-lod.ttl.out │ │ │ │ │ ├── public-opentag-contrib.ttl │ │ │ │ │ ├── public-prov-wg.ttl │ │ │ │ │ ├── public-prov-wg.ttl.out │ │ │ │ │ ├── public-rdf-prov.ttl │ │ │ │ │ ├── public-rdf-prov.ttl.out │ │ │ │ │ ├── public-rdf-wg.ttl │ │ │ │ │ ├── public-rdf-wg.ttl.out │ │ │ │ │ └── w3-org.ttl.out │ │ │ │ ├── per-group.py │ │ │ │ ├── per-month-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── public-prov-wg-2012-jul-conservative.ttl │ │ │ │ │ ├── public-prov-wg-2012-jul.ttl │ │ │ │ │ ├── public-prov-wg-2012-jul.ttl.out │ │ │ │ │ ├── public-prov-wg.ttl │ │ │ │ │ └── public-prov-wg.ttl.out │ │ │ │ ├── per-month.py │ │ │ │ └── readme.md │ │ ├── internet-domain.py │ │ ├── lodcloud │ │ │ ├── max-1-topic-tag-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── pass-and-fail.ttl │ │ │ ├── max-1-topic-tag.py │ │ │ ├── tagged-with-lod-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── pass-and-fail.ttl │ │ │ │ │ └── pass-and-fail.ttl.viajava │ │ │ └── tagged-with-topic-materials │ │ │ │ └── sample-inputs │ │ │ │ ├── pass-and-fail.ttl │ │ │ │ └── pass-and-fail.ttl.viajava │ │ ├── logd-datasets.rdf │ │ ├── metadata │ │ │ ├── logd-catalog-listing.py │ │ │ └── logd-catalog-listing.ttl │ │ ├── naming │ │ │ ├── between-the-edges-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── healthdata-tw-rpi-edu-cr-full-dump-latest-exemplars.ttl │ │ │ │ │ └── healthdata-tw-rpi-edu-cr-full-dump-latest-exemplars.ttl.out │ │ │ ├── between-the-edges.py │ │ │ └── uris-do-not-start-with-file-protocol.txt │ │ ├── predicate-counter-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── predicate-counter.py │ │ ├── provenance │ │ │ ├── named-graph-derivation-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── golfers.ttl │ │ │ └── named-graph-derivation.py │ │ ├── readme.md │ │ ├── redirect-loop-materials │ │ │ └── sample-inputs │ │ │ │ ├── does-not-have-redirect-loop.ttl │ │ │ │ └── has-redirect-loop.ttl │ │ ├── redirect-loop.py │ │ ├── resolvability-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── resolvability.py │ │ ├── sparql-service-description │ │ │ ├── named-graphs-materials │ │ │ │ └── sample-inputs │ │ │ │ │ ├── logd.ttl │ │ │ │ │ ├── logd.ttl.out │ │ │ │ │ ├── mondeca.rq │ │ │ │ │ ├── mondeca.sh │ │ │ │ │ ├── mondeca.ttl │ │ │ │ │ ├── mondeca.ttl.out │ │ │ │ │ └── mondeca │ │ │ │ │ ├── mondeca.rq.RDFXML │ │ │ │ │ └── mondeca.rq.RDFXML.pml.ttl │ │ │ └── named-graphs.py │ │ ├── triple-count-accuracy.py │ │ ├── typing │ │ │ ├── instance-types-are-known-by-domain-and-range.rtf │ │ │ └── instances-are-explicitly-typed.py │ │ ├── vocabulary-count-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── vocabulary-count.py │ │ ├── vocabulary │ │ │ ├── class-and-predicate-capitalization.py │ │ │ ├── instances-in-same-namespace-as-ontology-bad.txt │ │ │ ├── uses │ │ │ │ ├── dcat.py │ │ │ │ ├── dcterms.py │ │ │ │ ├── prov-materials │ │ │ │ │ └── sample-inputs │ │ │ │ │ │ ├── dbpedia-deref.ttl │ │ │ │ │ │ ├── dbpedia-deref.ttl.out │ │ │ │ │ │ ├── dbpedia-lifted.ttl │ │ │ │ │ │ ├── dbpedia-lifted.ttl.out │ │ │ │ │ │ ├── dbpedia.ttl │ │ │ │ │ │ ├── nothing.ttl │ │ │ │ │ │ ├── twc-healthdata-deref.ttl │ │ │ │ │ │ └── twc-healthdata-deref.ttl.out │ │ │ │ ├── prov.py │ │ │ │ └── void.py │ │ │ ├── vocabulary-resolves-to-description-materials │ │ │ │ └── sample-inputs │ │ │ │ │ └── myclass.ttl │ │ │ └── vocabulary-resolves-to-description.py │ │ ├── void-properties-materials │ │ │ └── sample-input │ │ │ │ └── congresspeople-datadump.ttl │ │ ├── void-properties.py │ │ ├── void-triples-materials │ │ │ └── sample-inputs │ │ │ │ ├── has-triples-asserted-when-dereferenced.rdf │ │ │ │ └── has-triples-asserted.ttl │ │ └── void-triples.py │ ├── prov │ │ ├── rdf2asn-materials │ │ │ └── sample-inputs │ │ │ │ └── multiple-types.ttl │ │ └── rdf2asn.py │ ├── readme.md │ ├── sadi-services.war │ └── util │ │ ├── wikitable-fol-materials │ │ └── sample-inputs │ │ │ ├── WD-prov-dm-20120202.html │ │ │ ├── provdm-wd3.ttl │ │ │ ├── provdm-wd4.ttl │ │ │ └── provdm.ttl │ │ ├── wikitable-fol.py │ │ ├── wikitable-gspo-materials │ │ └── sample-inputs │ │ │ ├── ProvRDF.html │ │ │ ├── Provenance_Vocabulary_Mappings.html │ │ │ ├── prov-xg-mappings.ttl │ │ │ ├── prov-xg-mappings.ttl.out │ │ │ ├── provrdf.ttl │ │ │ └── provrdf.ttl.out │ │ └── wikitable-gspo.py └── test │ ├── git2prov │ └── sample-inputs │ │ ├── opendap.ttl │ │ ├── opendap.ttl.rdf │ │ ├── opendap.ttl.rdf.out.ttl │ │ └── run │ └── wikipedia-2-dbpedia-materials │ ├── on-datafaqstest.rdf │ ├── on-datafaqstest.url │ └── sample-inputs │ ├── us-domain.ttl │ ├── us-domain.ttl.rdf │ └── us-domain.ttl.rdf.out └── src ├── java └── sadi-services │ ├── .gitignore │ ├── create-new-sadi-java-file │ ├── doc │ └── eclipse │ │ └── generate war.launch │ ├── pom.xml │ ├── readme.md │ └── src │ └── main │ └── java │ └── edu │ └── rpi │ └── tw │ └── data │ ├── ckan │ └── CKANReader.java │ ├── naming │ └── NameFactory.java │ ├── provenance │ └── Git2PROV.java │ ├── quality │ └── sadi │ │ ├── ckan │ │ └── LiftCKAN.java │ │ └── faqt │ │ ├── FAqT.java │ │ ├── core │ │ └── select │ │ │ └── datasets │ │ │ ├── ByCKANGroup.java │ │ │ └── ByCKANTag.java │ │ └── sparql_service_description │ │ └── NamedGraphs.java │ └── rdf │ └── jena │ ├── ANY.java │ └── vocabulary │ ├── CON.java │ ├── DCAT.java │ ├── DataFAQs.java │ ├── FOAF.java │ ├── Formats.java │ ├── GeoNames.java │ ├── OV.java │ ├── PROV.java │ ├── Prefixes.java │ ├── SD.java │ ├── SIO.java │ ├── SIOC.java │ ├── Tag.java │ ├── VoID.java │ └── WGS.java └── python └── faqt.python ├── .gitignore ├── dist ├── faqt-0.0.1-py2.6.egg ├── faqt-0.0.1-py2.7.egg ├── faqt-0.0.2-py2.6.egg └── faqt-0.0.2-py2.7.egg ├── example.py ├── ez_setup.py ├── faqt ├── __init__.py └── faqt.py ├── prov.ttl ├── readme.md └── setup.py /bin/df-SPARQLQuery.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Output an RDF description of the given SPARQL query. 4 | # 5 | # This output can be used by: 6 | # https://github.com/timrdf/DataFAQs/blob/master/services/sadi/core/select-datasets/via-sparql-query.py 7 | # and 8 | # https://github.com/timrdf/DataFAQs/blob/master/services/sadi/core/select-faqts/via-sparql-query.py 9 | # to produce lists of datasets and evaluation services, respectively. 10 | # 11 | # Example usage: 12 | # df-SPARQLQuery.py csv2rdf4lod-dataset-samples-in-endpoint.rq@http://logd.tw.rpi.edu/sparql 13 | # ^-query ^-endpoint 14 | # 15 | # Not implemented: within a given named graph: 16 | # df-SPARQLQuery.py csv2rdf4lod-dataset-samples-in-endpoint.rq@http://NAMED-GRAPH@http://logd.tw.rpi.edu/sparql 17 | # ^-query (should not have where graph?x{}) ^-graph name ^-endpoint 18 | # 19 | # TODO: write to file with consistent name that adds the endpoint to it, align the file URLs. 20 | # see https://github.com/timrdf/DataFAQs/issues/111 21 | 22 | import sys, re 23 | 24 | if not (re.match('^[^@]*@[^@]*$',sys.argv[1]) or re.match('^[^@]*@[^@]*@[^@]*$',sys.argv[1])): 25 | print 'usage: ' 26 | sys.exit(1) 27 | 28 | parts = sys.argv[1].split('@') 29 | query_file=parts[0] # e.g. 'csv2rdf4lod-dataset-samples-in-endpoint.rq' 30 | named_graph=parts[1] if len(parts) > 2 else '' # TODO: logic below if this is set. 31 | endpoint=parts[len(parts)-1] # e.g. 'http://logd.tw.rpi.edu/sparql' 32 | 33 | base='https://raw.github.com/timrdf/DataFAQs/master/services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/' 34 | 35 | ttl=query_file.replace('.rq','.ttl') 36 | 37 | description=''' 38 | @prefix rdf: . 39 | @prefix rdfs: . 40 | @prefix sd: . 41 | @prefix datafaqs: . 42 | @prefix : <'''+base+ttl+'''#> . 43 | 44 | :apply 45 | a datafaqs:QueryToApply; 46 | datafaqs:query <'''+base+query_file+'''>; 47 | datafaqs:dataset :dataset; 48 | . 49 | 50 | <'''+base+query_file+'''> 51 | a datafaqs:SPARQLQuery; 52 | rdfs:comment "One could resolve the URI for this query, or use the given rdf:value"; 53 | rdf:value 54 | """{contents}"""; 55 | . 56 | 57 | :dataset 58 | a sd:Dataset; 59 | rdfs:comment "We want to query the entire endpoint."; 60 | . 61 | 62 | :sparql-service 63 | a sd:Service; 64 | sd:availableGraphDescriptions :dataset; 65 | sd:endpoint <{endpoint}>; 66 | .'''.format(contents = open(query_file,'r').read(), 67 | endpoint = 'http://logd.tw.rpi.edu/sparql') 68 | 69 | print re.sub('^\s','',description,1) 70 | 71 | print '#3> <> prov:wasGeneratedBy [ ' 72 | print '#3> dcterms:description "'+re.sub('^.*/','',sys.argv[0])+' '+sys.argv[1]+'";' 73 | print '#3> prov:qualifiedAssociation [' 74 | print '#3> a prov:Association;' 75 | print '#3> prov:hadPlan ;' 76 | print '#3> ];' 77 | print '#3> ]; .' 78 | -------------------------------------------------------------------------------- /bin/df-conneg-heads.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -lt 1 || "$1" == "--help" ]]; then 4 | echo "usage: `basename $0` url" 5 | exit 1 6 | fi 7 | 8 | while [ $# -gt 0 ]; do 9 | uri="$1" 10 | echo "no Accept:" 11 | curl --silent -L $uri | head 12 | for content_type in 'application/rdf+xml' 'text/turtle' 'text/plain'; do 13 | echo; echo; echo; echo; echo; 14 | echo $content_type 15 | echo curl --silent -H "\"Accept: $content_type\"" -L $uri 16 | curl --silent -H "\"Accept: $content_type\"" -L $uri | head 17 | done 18 | shift 19 | done 20 | -------------------------------------------------------------------------------- /bin/df-list-faqts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Output an RDF description of all FAqT evaluation service implementations 4 | # nested within the current directory. 5 | # 6 | # The output can be used as a service registery, and can be used to synchronize 7 | # with others' registeries. 8 | # 9 | # Example usage: 10 | # 11 | # cd DataFAQs/services/sadi 12 | # df-list-faqts.py > all.ttl 13 | # rapper -qg -o rdfxml all.ttl > all.rdf 14 | # git add all.* 15 | 16 | import os, fnmatch 17 | 18 | implementations = [] 19 | for root, dirnames, filenames in os.walk('.'): 20 | for filename in fnmatch.filter(filenames, '*.py'): 21 | implementations.append(os.path.join(root, filename)) 22 | 23 | omit = { 24 | 'path' : [ 'faqt-template', 'core/cross' ], 25 | 'base' : [ 'test', 'ckan', 'contextual-inverse-functional', 'prov', 'util' ] 26 | } 27 | 28 | print '@prefix datafaqs: .' 29 | print 30 | 31 | # ./core/select-datasets/via-sparql-query.py 32 | for implementation in implementations: 33 | path = implementation.replace('./','').replace('.py','') 34 | 35 | blacklisted = path in omit['path'] 36 | for base in omit['base']: 37 | blacklisted = blacklisted or path.startswith(base) 38 | 39 | if not blacklisted: 40 | print '<'+path+'>' + ' a datafaqs:SADIService', 41 | 42 | if path.startswith('faqt'): 43 | print ', datafaqs:FAqTService', 44 | 45 | if path.startswith('core'): 46 | print ', datafaqs:CoreService', 47 | 48 | if path.startswith('core/select-faqts'): 49 | print ', datafaqs:FAqTSelector', 50 | 51 | if path.startswith('core/select-datasets'): 52 | print ', datafaqs:DatasetSelector', 53 | 54 | if path.startswith('core/augment-datasets/by-reference'): 55 | print ', datafaqs:DatasetReferencer', 56 | 57 | print ' .' 58 | 59 | # http://aquarius.tw.rpi.edu/projects/datafaqs/services/sadi/core/select-datasets/via-sparql-query 60 | # ./core/select-datasets/via-sparql-query.py 61 | 62 | -------------------------------------------------------------------------------- /bin/df-mirror-endpoint.sh.rq: -------------------------------------------------------------------------------- 1 | PREFIX sd: 2 | PREFIX foaf: 3 | PREFIX prov: 4 | 5 | SELECT ?input ?when 6 | WHERE { 7 | ?activity 8 | a prov:Activity; 9 | prov:used ?input, [ 10 | a sd:NamedGraph; 11 | sd:name 12 | ]; 13 | prov:startedAtTime ?when 14 | . 15 | ?input a foaf:Document . 16 | } 17 | -------------------------------------------------------------------------------- /bin/df-named-graphs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # <> prov:specializationOf . 4 | 5 | import sys 6 | from rdflib import * 7 | 8 | from surf import * 9 | from surf.query import a, select 10 | 11 | import rdflib 12 | rdflib.plugin.register('sparql', rdflib.query.Processor, 13 | 'rdfextras.sparql.processor', 'Processor') 14 | rdflib.plugin.register('sparql', rdflib.query.Result, 15 | 'rdfextras.sparql.query', 'SPARQLQueryResult') 16 | 17 | import xml.dom 18 | 19 | ns.register(prov='http://www.w3.org/ns/prov#') 20 | ns.register(dcat='http://www.w3.org/ns/dcat#') 21 | ns.register(void='http://rdfs.org/ns/void#') 22 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 23 | 24 | if len(sys.argv) < 2: 25 | print "usage: df-named-graphs.py " 26 | sys.exit() 27 | 28 | endpoint = sys.argv[1] 29 | 30 | store = Store( reader = "sparql_protocol", 31 | writer = "sparql_protocol", 32 | endpoint = endpoint) 33 | #results = store.execute_sparql('select distinct ?g where { graph ?g {[] a ?type}} order by ?g') 34 | results = store.execute_sparql('select distinct ?g where { graph ?g {[] a ?type}}') 35 | 36 | if isinstance(results,xml.dom.minidom.Document): 37 | for result in results.getElementsByTagName('result'): 38 | for binding in result.getElementsByTagName('binding'): 39 | for value in result.getElementsByTagName('uri'): 40 | print value.firstChild.data 41 | else: 42 | # If JSON results: 43 | for result in results['results']['bindings']: 44 | print result['g']['uri'] 45 | -------------------------------------------------------------------------------- /bin/df-purge-epochs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -lt 1 || "$1" == "--help" ]]; then 4 | echo "usage: `basename $0` [-n | -w] epoch [epoch...]" 5 | echo "-n dryrun" 6 | echo "-w do it" 7 | echo "epoch e.g. 2012-01-19 or __PIVOT_epoch/2012-01-19" 8 | exit 1 9 | fi 10 | 11 | dryRun="true" 12 | if [ "$1" == "-w" ]; then 13 | dryRun="false" 14 | shift 15 | elif [ "$1" == "-n" ]; then 16 | shift 17 | else 18 | echo "must specify -n or -w" 19 | exit 1 20 | fi 21 | 22 | while [ $# -gt 0 ]; do 23 | epoch="$1" 24 | if [[ ${#epoch} -gt 0 && ( -d "$epoch" || -d __PIVOT_epoch/"$epoch" ) ]]; then 25 | echo "Purging $epoch" 26 | if [ "$dryRun" == "false" ]; then 27 | rm -rf $epoch __PIVOT_epoch/$epoch &> /dev/null 28 | df-purge-orphaned-epochs.sh -w 29 | fi 30 | fi 31 | shift 32 | done 33 | -------------------------------------------------------------------------------- /bin/df-purge-orphaned-epochs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # https://github.com/timrdf/DataFAQs/blob/master/bin/datafaqs-purge-unlisted-epochs.sh 4 | # 5 | 6 | if [[ "$1" == "--help" || $# -ne 1 ]]; then 7 | echo "usage: `basename $0` <-n | -w>" 8 | echo 9 | echo " -n: perform dry run; do not modify anything." 10 | echo " -w: remove all epochs that are not listed in __PIVOT_epoch/" 11 | exit 0 12 | fi 13 | 14 | # Enforce directory conventions 15 | if [ `basename \`pwd\`` != "faqt-brick" ]; then 16 | echo "`basename $0` must be initiated at the faqt-brick root." 17 | echo "See https://github.com/timrdf/DataFAQs/wiki/FAqT-Brick" 18 | exit 1 19 | fi 20 | 21 | INFO="(dry run) [INFO]" 22 | dryrun="true" 23 | if [ "$1" == "-w" ]; then 24 | dryrun="false" 25 | INFO="[INFO]" 26 | shift 27 | fi 28 | 29 | keep_these="`pwd`/__PIVOT_epoch/" 30 | 31 | for pivot_epoch in `find * -name "__PIVOT_epoch"`; do 32 | pushd $pivot_epoch &> /dev/null 33 | for epoch in `$CSV2RDF4LOD_HOME/bin/util/directories.sh`; do 34 | if [ ! -d $keep_these/$epoch ]; then 35 | echo "$INFO Removing $epoch" 36 | if [ "$dryrun" == "false" ]; then 37 | rm -rf $epoch 38 | fi 39 | fi 40 | done 41 | popd &> /dev/null 42 | done 43 | -------------------------------------------------------------------------------- /bin/df-situate-paths.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | #3> <> prov:specializationOf . 4 | # 5 | # Usage: 6 | # export PATH=$PATH`$DATAFAQS_HOME/bin/df-situate-paths.sh` 7 | # (can be repeated indefinately, once paths are in PATH, nothing is returned.) 8 | 9 | HOME=$(cd ${0%/*} && echo ${PWD%/*}) 10 | 11 | if [ "$1" == "--help" ]; then 12 | echo "`basename $0` [--help]" 13 | echo 14 | echo "Return the shell paths needed for DataFAQs scripts to run." 15 | echo "Set them executing:" 16 | echo 17 | echo " export PATH=\$PATH\`$HOME/bin/${0##*/}\`" 18 | exit 19 | fi 20 | 21 | missing="" 22 | 23 | if [ ! `which df-epoch.sh` ]; then 24 | missing=":" 25 | missing=$missing$HOME/bin 26 | fi 27 | 28 | if [[ ! `which tdbloader` && -d "$TDBROOT" ]]; then 29 | if [ ${#missing} -gt 0 ]; then 30 | missing=$missing":" 31 | fi 32 | missing=$missing$TDBROOT/bin 33 | fi 34 | 35 | #if [ ! `which pcurl.sh` ]; then export PATH=$PATH:$DATAFAQS_HOME/bin/util 36 | # if [ ${#missing} -gt 0 ]; then 37 | # missing=$missing":" 38 | # fi 39 | # missing=$missing$DATAFAQS_HOME/bin/util 40 | #fi 41 | # 42 | #if [ ! `which vload` ]; then 43 | # if [ ${#missing} -gt 0 ]; then 44 | # missing=$missing":" 45 | # fi 46 | # missing=$missing$DATAFAQS_HOME/bin/util/virtuoso 47 | #fi 48 | 49 | echo $missing 50 | 51 | #for path in `echo ${PATH//:// }`; do 52 | # echo $path 53 | #done 54 | -------------------------------------------------------------------------------- /bin/get-binding.xsl: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /bin/randomize-line-order.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Example usage: 4 | # find automatic -name "*.ttl" | $DATAFAQS_HOME/bin/randomize-line-order.py 5 | 6 | import sys 7 | import random 8 | 9 | lines = [] 10 | for line in sys.stdin: 11 | lines.append(line) 12 | 13 | #lines.sort() 14 | 15 | length = len(lines) 16 | for l in range(0,length): 17 | choice = random.randint(0,len(lines)-1) 18 | #print str(choice) + ' of ' + str(len(lines)) 19 | print lines.pop(choice), 20 | -------------------------------------------------------------------------------- /bin/void-triples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Note taken from DataFAQs, now maintained in csv2rdf4lod-automation. 4 | 5 | # rapper -g -c b.ttl 6 | # rapper: Parsing returned 17 triples 7 | 8 | count=0 9 | while [ $# -gt 0 ]; do 10 | file="$1" 11 | if [ -e $file ]; then 12 | c=`rapper -g -c $file 2>&1 | grep "Parsing returned [^ ]* triples" | awk '{printf($4)}'` 13 | if [ ${#c} -gt 0 ]; then 14 | let "count=count+c" 15 | fi 16 | fi 17 | shift 18 | done 19 | echo $count 20 | -------------------------------------------------------------------------------- /doc/DataFAQs-framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/DataFAQs-framework.png -------------------------------------------------------------------------------- /doc/DataFAQs-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/DataFAQs-shadow.png -------------------------------------------------------------------------------- /doc/DataFAQs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/DataFAQs.png -------------------------------------------------------------------------------- /doc/ckan/ckan_logo_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/ckan_logo_box.png -------------------------------------------------------------------------------- /doc/ckan/lodcloud/lodcloud-hypermap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/lodcloud/lodcloud-hypermap.pdf -------------------------------------------------------------------------------- /doc/ckan/lodcloud/lodcloud-hypermap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/lodcloud/lodcloud-hypermap.png -------------------------------------------------------------------------------- /doc/ckan/lodcloud/vocab/ckan-lodcloud-rdf-vocabulary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/lodcloud/vocab/ckan-lodcloud-rdf-vocabulary.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/add-dataset-resources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/add-dataset-resources.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/add-dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/add-dataset.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/dataset-added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/dataset-added.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/resource-metadata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/resource-metadata.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/submit-dataset-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/submit-dataset-title.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/title-dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/title-dataset.png -------------------------------------------------------------------------------- /doc/ckan/tutorial/your-api-key-is.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/ckan/tutorial/your-api-key-is.png -------------------------------------------------------------------------------- /doc/diagrams/SplitNVC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/diagrams/SplitNVC.pdf -------------------------------------------------------------------------------- /doc/diagrams/SplitNVC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/diagrams/SplitNVC.png -------------------------------------------------------------------------------- /doc/examples/default/faqt-brick/datafaqs-source-me.sh: -------------------------------------------------------------------------------- 1 | #3> <> rdfs:seeAlso . 2 | 3 | # Local settings 4 | export DATAFAQS_HOME=${DATAFAQS_HOME:-"/opt/DataFAQs"} 5 | export PATH=$PATH`$DATAFAQS_HOME/bin/df-situate-paths.sh` 6 | export DATAFAQS_LOG_DIR="`pwd`/log" 7 | 8 | # Deployment settings: 9 | export DATAFAQS_BASE_URI='http://aquarius.tw.rpi.edu/projects/datafaqs' # No ending slash 10 | export DATAFAQS_PROVENANCE_CODE_RAW_BASE='https://github.com/timrdf/DataFAQs/blob/master' # No ending slash 11 | export DATAFAQS_PROVENANCE_CODE_PAGE_BASE='https://raw.github.com/timrdf/DataFAQs/master' # No ending slash 12 | 13 | # Publishing: 14 | export DATAFAQS_PUBLISH_THROUGHOUT_EPOCH="true" 15 | export DATAFAQS_PUBLISH_METADATA_GRAPH_NAME="http://www.w3.org/ns/sparql-service-description#NamedGraph" 16 | 17 | # If using TDB: 18 | export DATAFAQS_PUBLISH_TDB="true" 19 | export DATAFAQS_PUBLISH_TDB_DIR="`pwd`/tdb" 20 | export TDBROOT="/opt/tdb/TDB-0.8.10" 21 | if [ ! `which tdbloader` ]; then 22 | export PATH=$PATH":$TDBROOT/bin" 23 | fi 24 | 25 | # If using Virtuoso: 26 | export DATAFAQS_PUBLISH_VIRTUOSO='true' 27 | export CSV2RDF4LOD_CONVERT_DATA_ROOT="`pwd`" 28 | export CSV2RDF4LOD_PUBLISH_VIRTUOSO_HOME='/opt/virtuoso' 29 | export CSV2RDF4LOD_PUBLISH_VIRTUOSO_ISQL_PATH='' # defaults to guess 30 | export CSV2RDF4LOD_PUBLISH_VIRTUOSO_PORT=1111 31 | export CSV2RDF4LOD_PUBLISH_VIRTUOSO_USERNAME='dba' 32 | export CSV2RDF4LOD_PUBLISH_VIRTUOSO_PASSWORD='your-virtuoso-password' 33 | 34 | # Local software dependencies: 35 | export CSV2RDF4LOD_HOME=${CSV2RDF4LOD_HOME:-"/opt/csv2rdf4lod-automation"} 36 | export PATH=$PATH`$CSV2RDF4LOD_HOME/bin/util/cr-situate-paths.sh` 37 | -------------------------------------------------------------------------------- /doc/examples/lodcloud-50-tags/faqt-brick/epoch.ttl: -------------------------------------------------------------------------------- 1 | @prefix prov: . 2 | @prefix datafaqs: . 3 | 4 | <> prov:specializationOf . 5 | 6 | # # # # # # # # # # 7 | _:selectfaqtservices # Every time you load this file, we're talking about a new activity (the one you're about to instantiate). 8 | a prov:Activity; 9 | prov:wasAttributedTo 10 | ; 11 | prov:used 12 | ; 13 | prov:hadQualifiedAttribution [ 14 | a prov:Attribution; 15 | prov:hadQualifiedEntity ; 16 | prov:adoptedPlan ; 17 | ]; 18 | prov:generated _:faqtlist; # the RDF graph that via-sparql-query returns (we don't know the name of it yet until we instantiate the epoch). 19 | . 20 | 21 | 22 | a datafaqs:FAqTSelector, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 23 | . 24 | 25 | 26 | # # # # # # # # # # 27 | _:selectdatasets 28 | a prov:Activity; 29 | prov:wasAttributedTo 30 | ; 31 | prov:used 32 | ; 33 | prov:hadQualifiedAttribution [ 34 | a prov:Attribution; 35 | prov:hadQualifiedEntity ; 36 | prov:adoptedPlan ; 37 | ]; 38 | prov:generated _:datasetlist; # the RDF graph that by-ckan-group returns (we don't know the name of it yet until we instantiate the epoch). 39 | . 40 | 41 | 42 | a datafaqs:DatasetSelector, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 43 | . 44 | 45 | 46 | # # # # # # # # # # 47 | _:referencedatasets 48 | a prov:Activity; 49 | prov:wasAttributedTo 50 | ; 51 | prov:used _:datasetlist; 52 | prov:hadQualifiedAttribution [ 53 | a prov:Attribution; 54 | prov:hadQualifiedEntity ; 55 | prov:adoptedPlan ; 56 | ]; 57 | prov:generated _:seeAlsolist; # the RDF graph that with-preferred-uri-and-ckan-meta-void returns (we don't know the name of it yet until we instantiate the epoch). 58 | . 59 | 60 | 61 | a datafaqs:DatasetReferencer, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 62 | . 63 | -------------------------------------------------------------------------------- /doc/examples/named-graph-attribution/epoch.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix foaf: . 3 | @prefix prov: . 4 | @prefix datafaqs: . 5 | 6 | <> prov:specializationOf ; 7 | foaf:homepage ; 8 | rdfs:seeAlso ; 9 | . 10 | 11 | # # # # # # # # # # 12 | _:selectfaqtservices # Every time you load this file, we're talking about a new activity (the one you're about to instantiate). 13 | a datafaqs:FAqTSelection, prov:Activity; 14 | prov:wasAttributedTo 15 | ; 16 | prov:used 17 | ; 18 | prov:generated _:faqtlist; # the RDF graph that via-sparql-query returns (we don't know the name of it yet until we instantiate the epoch). 19 | . 20 | 21 | 22 | a datafaqs:FAqTSelector, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 23 | . 24 | 25 | 26 | # # # # # # # # # # 27 | _:selectdatasets 28 | a prov:Activity; 29 | prov:wasAttributedTo 30 | ; 31 | prov:used 32 | ; 33 | prov:generated _:datasetlist; # the RDF graph that by-ckan-group returns (we don't know the name of it yet until we instantiate the epoch). 34 | . 35 | 36 | 37 | a datafaqs:DatasetSelector, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 38 | . 39 | 40 | 41 | # # # # # # # # # # 42 | #_:referencedatasets 43 | # a prov:Activity; 44 | # prov:wasAttributedTo 45 | # ; 46 | # prov:used _:datasetlist; 47 | # prov:hadQualifiedAttribution [ 48 | # a prov:Attribution; 49 | # prov:hadQualifiedEntity ; 50 | # prov:adoptedPlan ; 51 | # ]; 52 | # prov:generated _:seeAlsolist; # the RDF graph that with-preferred-uri-and-ckan-meta-void returns (we don't know the name of it yet until we instantiate the epoch). 53 | #. 54 | # 55 | # 56 | # a datafaqs:DatasetReferencer, datafaqs:CoreService, datafaqs:SADIService, prov:Agent; 57 | #. 58 | -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-dimensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-dimensions.png -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-directory-convention.graffle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-directory-convention.graffle.pdf -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-epoch-dataset-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-epoch-dataset-description.png -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-epoch-evaluation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-epoch-evaluation.png -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-epoch-faqt-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-epoch-faqt-description.png -------------------------------------------------------------------------------- /doc/faqt-brick/faqt-brick-epoch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/faqt-brick/faqt-brick-epoch.png -------------------------------------------------------------------------------- /doc/lodspeakr/lodspeakr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/lodspeakr/lodspeakr.png -------------------------------------------------------------------------------- /doc/lodspeakr/lodspeakr_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/lodspeakr/lodspeakr_4.png -------------------------------------------------------------------------------- /doc/papers/lebo2012ipaw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/papers/lebo2012ipaw.pdf -------------------------------------------------------------------------------- /doc/papers/mccusker2012ipaw.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/papers/mccusker2012ipaw.pdf -------------------------------------------------------------------------------- /doc/presentations/2012.03.07_lebo-datafaqs-twed.ppt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/presentations/2012.03.07_lebo-datafaqs-twed.ppt.pdf -------------------------------------------------------------------------------- /doc/presentations/2012.04.25_lebo-datafaqs-issues.ppt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/presentations/2012.04.25_lebo-datafaqs-issues.ppt.pdf -------------------------------------------------------------------------------- /doc/presentations/2012.06.20_lebo-ipaw.ppt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/presentations/2012.06.20_lebo-ipaw.ppt.pdf -------------------------------------------------------------------------------- /doc/presentations/2012.06.20_mccusker-ipaw.ppt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/presentations/2012.06.20_mccusker-ipaw.ppt.pdf -------------------------------------------------------------------------------- /doc/sadi/sadi-generate-service-run-config-missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/sadi/sadi-generate-service-run-config-missing.png -------------------------------------------------------------------------------- /doc/sadi/sadi-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/doc/sadi/sadi-header.png -------------------------------------------------------------------------------- /lib/RDFAlerts.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/lib/RDFAlerts.war -------------------------------------------------------------------------------- /lib/sadi-services.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/lib/sadi-services.jar -------------------------------------------------------------------------------- /lib/sadi.python/readme.md: -------------------------------------------------------------------------------- 1 | These are compiled from source, since they may be ahead of Jim's releases [on Google Code](http://code.google.com/p/sadi/downloads/list). 2 | 3 | Compiling done by: 4 | 5 | ``` 6 | svn checkout http://sadi.googlecode.com/svn/trunk/python/sadi.python sadi.python 7 | cd sadi.python 8 | python setup.py bdist_egg 9 | ``` 10 | 11 | which appears in dist/sadi-0.1.4-py2.6.egg 12 | 13 | ``` 14 | cp dist/sadi-0.1.5-py2.7.egg $DATAFAQS_HOME/lib/sadi.python/ 15 | ``` 16 | 17 | To install these, run: 18 | 19 | sudo easy_install https://github.com/timrdf/DataFAQs/raw/master/lib/sadi.python/sadi-0.1.5-py2.6.egg 20 | -------------------------------------------------------------------------------- /lib/sadi.python/sadi-0.1.5-py2.6.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/lib/sadi.python/sadi-0.1.5-py2.6.egg -------------------------------------------------------------------------------- /lib/sadi.python/sadi-0.1.5-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/lib/sadi.python/sadi-0.1.5-py2.7.egg -------------------------------------------------------------------------------- /ontology/between-the-edges.owl.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix : . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix xsd: . 6 | @prefix bte: . 7 | @prefix skos: . 8 | @prefix dcterms: . 9 | 10 | 11 | a owl:Ontology ; 12 | rdfs:comment "A vocabulary to describe the implicit relationships within the literal URI."@en ; 13 | rdfs:seeAlso . 14 | 15 | bte:HashEndURI 16 | a owl:Class ; 17 | rdfs:subClassOf bte:HashURI . 18 | 19 | bte:HashURI 20 | a owl:Class ; 21 | rdfs:comment "URI contains a hash (#). For example, ."@en ; 22 | rdfs:subClassOf bte:RDFNode . 23 | 24 | bte:Node 25 | a owl:Class ; 26 | rdfs:comment "Any rdfs:Resource that is output by a Between The Edges analysis."@en . 27 | 28 | bte:PrefixTree 29 | a dcterms:FileFormat ; 30 | rdfs:comment "A concise tree format organizes strings by their common prefixes. Includes local and recursive weight counts."@en ; 31 | rdfs:seeAlso . 32 | 33 | bte:RDFNode 34 | a owl:Class ; 35 | rdfs:comment "An rdfs:Resource that was analyzed by Between The Edges, as opposed to rdfs:Resources that resulted from the Between The Edges analysis."@en ; 36 | rdfs:subClassOf bte:Node . 37 | 38 | bte:SlashEndURI 39 | a owl:Class ; 40 | rdfs:subClassOf bte:SlashURI . 41 | 42 | bte:SlashURI 43 | a owl:Class ; 44 | rdfs:subClassOf bte:RDFNode . 45 | 46 | bte:broader 47 | a owl:ObjectProperty ; 48 | rdfs:domain bte:Node ; 49 | rdfs:range bte:Node . 50 | 51 | bte:length 52 | a owl:DatatypeProperty ; 53 | rdfs:comment "The string length of the URI."@en . 54 | 55 | bte:scheme 56 | a owl:DatatypeProperty ; 57 | rdfs:comment "The addressing scheme of the URL. For example, http, file, gopher, mailto, ftp, etc."@en . 58 | 59 | bte:step 60 | a owl:DatatypeProperty ; 61 | rdfs:comment "The local name portion of the URI, after the slash."@en . 62 | 63 | rdfs:comment 64 | a owl:AnnotationProperty . 65 | 66 | -------------------------------------------------------------------------------- /ontology/mirror-ontology.htaccess: -------------------------------------------------------------------------------- 1 | # Options +MultiViews 2 | # AddType application/rdf+xml .rdf .owl 3 | # AddType text/turtle .ttl 4 | -------------------------------------------------------------------------------- /ontology/mirror-ontology.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Hosts the vocabularies. 3 | # These files are pointed at by purl.org: 4 | 5 | pushd /var/www/vocab 6 | # http://purl.org/twc/vocab/datafaqs# redirects to: 7 | sudo rm datafaqs.ttl datafaqs.owl 8 | sudo wget -O datafaqs.ttl https://raw.github.com/timrdf/DataFAQs/master/ontology/datafaqs.ttl 9 | sudo wget -O datafaqs.owl https://raw.github.com/timrdf/DataFAQs/master/ontology/datafaqs.ttl.owl 10 | 11 | # http://purl.org/twc/vocab/conversion/ redirects to: 12 | sudo rm conversion.ttl conversion.owl 13 | sudo wget -O conversion.ttl https://raw.github.com/timrdf/csv2rdf4lod-automation/master/doc/ontology/vocab.ttl 14 | sudo wget -O conversion.owl https://raw.github.com/timrdf/csv2rdf4lod-automation/master/doc/ontology/vocab.owl 15 | 16 | ls -lt /var/www/vocab 17 | -------------------------------------------------------------------------------- /ontology/resolves-to-incorrect-content-type.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix owl: . 4 | @prefix xsd: . 5 | @prefix : . 6 | 7 | :MyClass 8 | a owl:Class; 9 | rdfs:comment "This class is defined within a namepace that resolves to an incorrectly-typed RDFS/OWL file."; 10 | rdfs:comment """The 'text/plain' from github should be 'text/turtle': 11 | bash-3.2$ curl -LI http://purl.org/twc/vocab/resolves-to-incorrect-content-type 12 | HTTP/1.1 302 Moved Temporarily 13 | Location: https://raw.github.com/timrdf/DataFAQs/master/ontology/resolves-to-incorrect-content-type.ttl 14 | Content-Type: text/html; charset=iso-8859-1 15 | Content-Length: 326 16 | 17 | HTTP/1.1 200 OK 18 | Content-Type: text/plain; charset=utf-8"""; 19 | . 20 | 21 | :myclass 22 | a :MyClass; 23 | rdfs:comment "An instance so that the vocabulary will be checked."; 24 | . 25 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | See https://github.com/timrdf/DataFAQs/wiki 2 | -------------------------------------------------------------------------------- /services/sadi/ckan/add-metadata-materials/sample-inputs/arrayexpress_e-afmx-4.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix owl: . 3 | @prefix dcterms: . 4 | @prefix foaf: . 5 | @prefix con: . 6 | @prefix moat: . 7 | @prefix ov: . 8 | @prefix dcat: . 9 | @prefix void: . 10 | @prefix sd: . 11 | @prefix datafaqs: . 12 | @prefix prov: . 13 | 14 | 15 | a datafaqs:CKANDataset; 16 | datafaqs:ckan_identifier "arrayexpress_e-afmx-4"; 17 | con:preferredURI ; 18 | 19 | dcterms:title "Transcription profiling of mouse cell types and tissues (GNF/Novartis)"; 20 | ov:shortName "E-AFMX-4"; 21 | 22 | dcterms:description "The tissue-specific pattern of mRNA expression can indicate important clues about gene function. High-density oligonucleotide arrays offer the opportunity to examine patterns of gene expression on a genome scale. Toward this end, we have designed custom arrays that interrogate the expression of the vast majority of protein-encoding human and mouse genes and have used them to profile a panel of 79 human and 61 mouse tissues. The resulting data set provides the expression patterns for thousands of predicted genes, as well as known and poorly characterized genes, from mice and humans. We have explored this data set for global trends in gene expression, evaluated commonly used lines of evidence in gene prediction methodologies, and investigated patterns indicative of chromosomal organization of transcription. We describe hundreds of regions of correlated transcription and show that some are subject to both tissue and parental allele-specific expression, suggesting a link between spatial expression and imprinting."; 23 | 24 | dcterms:isPartOf ; 25 | . 26 | a datafaqs:CKANGroup . 27 | -------------------------------------------------------------------------------- /services/sadi/ckan/add-metadata-materials/sample-inputs/congresspeople-tagged-government.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix void: . 6 | @prefix con: . 7 | @prefix moat: . 8 | @prefix datafaqs: . 9 | 10 | 11 | a datafaqs:CKANDataset ; 12 | datafaqs:namespace ; 13 | con:preferredURI ; 14 | foaf:isPrimaryTopicOf ; 15 | dcterms:identifier "f4c2a8bb-6580-4919-98aa-617feb766b6c"; 16 | 17 | ov:shortName "congresspeople"; 18 | a ov:DigitalAsset; 19 | 20 | a datafaqs:TaggedCKANDataset; 21 | moat:taggedWithTag ; 22 | a sioc:Item; 23 | 24 | void:vocabulary 25 | , 26 | , 27 | , 28 | , 29 | , 30 | , 31 | , 32 | , 33 | , 34 | , 35 | , 36 | , 37 | , 38 | , 39 | , 40 | , 41 | , 42 | ; 43 | a void:Dataset; 44 | void:subset [ 45 | a void:Linkset; 46 | void:target , 47 | ; 48 | void:triples 67; 49 | ]; 50 | 51 | void:subset [ 52 | a void:Linkset; 53 | void:target , 54 | ; 55 | void:triples 50; 56 | ]; 57 | 58 | void:subset [ 59 | a void:Linkset; 60 | void:target , 61 | ; 62 | void:triples 56; 63 | ]; 64 | 65 | dcterms:isPartOf ; 66 | . 67 | 68 | a datafaqs:CKANGroup . 69 | -------------------------------------------------------------------------------- /services/sadi/ckan/add-metadata-materials/sample-inputs/farmers-markets-geographic-data-united-states-tagged-with-geographic.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix moat: . 6 | @prefix datafaqs: . 7 | 8 | 9 | a datafaqs:CKANDataset; 10 | foaf:isPrimaryTopicOf ; 11 | dcterms:identifier "91d2c0de-75a4-4bb6-b260-bc2946e1be8b"; 12 | 13 | ov:shortName "farmers-markets-geographic-data-united-states"; 14 | a ov:DigitalAsset; 15 | 16 | a datafaqs:TaggedCKANDataset; 17 | moat:taggedWithTag ; 18 | a sioc:Item; 19 | . 20 | -------------------------------------------------------------------------------- /services/sadi/ckan/add-metadata-materials/sample-inputs/food-recalls.ttl: -------------------------------------------------------------------------------- 1 | #3> <> prov:wasDerivedFrom . 2 | 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix dcterms: . 6 | @prefix foaf: . 7 | @prefix con: . 8 | @prefix moat: . 9 | @prefix ov: . 10 | @prefix dcat: . 11 | @prefix void: . 12 | @prefix conversion: . 13 | @prefix sd: . 14 | @prefix datafaqs: . 15 | @prefix prov: . 16 | 17 | 18 | a datafaqs:CKANDataset; 19 | dcterms:identifier "food-recalls"; 20 | #con:preferredURI ; 21 | 22 | #dcterms:title "Transcription profiling of human, chimp and mouse brain"; 23 | #ov:shortName "E-AFMX-1"; 24 | 25 | #dcterms:description "description"; 26 | 27 | #void:triples 3014; 28 | 29 | #dcterms:contributor [ 30 | # foaf:mbox ; 31 | # foaf:name "James McCusker"; 32 | #]; 33 | 34 | #dcterms:creator [ 35 | # foaf:mbox ; 36 | # foaf:name "Endre Anderssen"; 37 | #]; 38 | 39 | #dcterms:isPartOf ; 40 | 41 | #void:vocabulary , 42 | # , 43 | # ; 44 | 45 | #moat:taggedWithTag ; # multiple ok. 46 | 47 | prov:alternateOf # This is not tied into add-metadata. 48 | , # The original entry 49 | ; # Our RDF version of it. 50 | 51 | #void:sparqlEndpoint ; # Not appropriate on a non-RDF dataset. 52 | dcat:distribution [ 53 | a sd:NamedGraph; 54 | sd:name ; 55 | #sd:graph <>; # We're not naming the set of triples. 56 | prov:atLocation ; 57 | ]; 58 | . 59 | a conversion:ServiceEndpoint . 60 | 61 | a void:Dataset, conversion:AbstractDataset; 62 | . 63 | 64 | # a datafaqs:CKANGroup . 65 | # a moat:Tag; moat:name "lod" . 66 | -------------------------------------------------------------------------------- /services/sadi/ckan/add-metadata-materials/sample-inputs/white-house-visitor-access-records-tagged-government.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix moat: . 6 | @prefix datafaqs: . 7 | 8 | 9 | a datafaqs:CKANDataset; 10 | foaf:isPrimaryTopicOf ; 11 | dcterms:identifier "e59f5df0-05b4-40e5-99b1-f801c15e6e93"; 12 | 13 | ov:shortName "white-house-visitor-access-records"; 14 | a ov:DigitalAsset; 15 | 16 | a datafaqs:TaggedCKANDataset; 17 | moat:taggedWithTag ; 18 | moat:taggedWithTag ; 19 | a sioc:Item; 20 | . 21 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/any-ckan-instance.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix datafaqs: . 3 | @prefix prov: . 4 | 5 | 6 | a datafaqs:CKANDataset; 7 | datafaqs:ckan_identifier "farmers-markets-geographic-data-united-states"; 8 | rdfs:comment "If the CKAN Dataset is not attributed to a CKAN, ask thedatahub.org."; 9 | . 10 | 11 | 12 | a datafaqs:CKANDataset; 13 | rdfs:comment "Omitting datafaqs:ckan_identifier will fall back to parsing the URI."; 14 | prov:wasAttributedTo ; 15 | . 16 | 17 | 18 | a datafaqs:CKANDataset; 19 | rdfs:comment "Omitting datafaqs:ckan_identifier will fall back to parsing the URI."; 20 | prov:wasAttributedTo ; 21 | . 22 | 23 | 24 | a datafaqs:CKAN; 25 | rdfs:comment "If the CKANDataset was attributed to a CKAN, ask that CKAN about it."; 26 | . 27 | 28 | a datafaqs:CKAN; 29 | rdfs:comment "If the CKANDataset was attributed to a CKAN, ask that CKAN about it."; 30 | . 31 | 32 | 33 | a datafaqs:CKANDataset; 34 | rdfs:comment "If no identifier and not attributed to a CKAN, parse the URI to ask http://datahub.io about 'twc-healthdata'."; 35 | . 36 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/elviajero.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/elviajero.rdf.out: -------------------------------------------------------------------------------- 1 | 4 | 5 | com.hp.hpl.jena.shared.ClosedException: already closed 6 | 7 | 8 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/twc-healthdata.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix datafaqs: . 3 | @prefix prov: . 4 | 5 | 6 | a datafaqs:CKANDataset; 7 | rdfs:comment "If no identifier and not attributed to a CKAN, parse the URI to ask http://datahub.io about 'twc-healthdata'."; 8 | . 9 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/twc-healthdata.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix ov: . 4 | @prefix owl: . 5 | @prefix pim: . 6 | @prefix sd: . 7 | @prefix void: . 8 | @prefix xsd: . 9 | 10 | <#service-6dbc461f172bd2236346b5cc15ab2a2d8eb45d7b89b543c477012745> a sd:Service; 11 | sd:endpoint . 12 | 13 | a datafaqs:CKANDataset; 14 | ov:shortName "twc-healthdata"; 15 | dcterms:description "Linked Data version of the metadata and data listed at http://hub.healthdata.gov."; 16 | dcterms:title "HealthData.gov Platform (HDP) on the Semantic Web"; 17 | void:sparqlEndpoint ; 18 | void:triples 1934046908; 19 | void:uriSpace "http://purl.org/twc/health/"; 20 | pim:preferredURI . 21 | 22 | a owl:Thing; 23 | dcterms:title "" . 24 | 25 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/two.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcat: . 3 | @prefix dcterms: . 4 | @prefix ov: . 5 | @prefix owl: . 6 | @prefix pim: . 7 | @prefix prov: . 8 | @prefix sd: . 9 | @prefix void: . 10 | @prefix xsd: . 11 | 12 | <#service-55060a6fc808f0c6b7ac51b9a7fdcc65bd2c90a717fc1dff4302ea4f> a sd:Service; 13 | sd:endpoint . 14 | 15 | a datafaqs:CKANDataset . 16 | 17 | <#linkset-dbpedia-66ff8c1194aebf93e4d793d96c9357cefee995821d0dc06438aa5d8c> a void:Linkset; 18 | void:target , 19 | ; 20 | void:triples 52 . 21 | 22 | <#linkset-geonames-semantic-web-169072b7427508465da0718c0ea3b4c72a6c60803f9c3d991e1803ec> a void:Linkset; 23 | void:target , 24 | ; 25 | void:triples 50 . 26 | 27 | <#linkset-govtrack-2c8e196100b12b0b8d6c53f6c945d8b98aab7c7a23621fd5a7d72d53> a void:Linkset; 28 | void:target , 29 | ; 30 | void:triples 52 . 31 | 32 | <#named-graph-c71c409f-2da1-4ec4-983c-63494963fdb6> a sd:NamedGraph; 33 | prov:atLocation ; 34 | sd:name . 35 | 36 | a owl:Thing; 37 | dcterms:title "Rensselaer LOGD SPARQL Endpoint" . 38 | 39 | a datafaqs:CKANDataset; 40 | ov:shortName "farmers-markets-geographic-data-united-states"; 41 | void:sparqlEndpoint ; 42 | void:subset <#linkset-dbpedia-66ff8c1194aebf93e4d793d96c9357cefee995821d0dc06438aa5d8c>, 43 | <#linkset-geonames-semantic-web-169072b7427508465da0718c0ea3b4c72a6c60803f9c3d991e1803ec>, 44 | <#linkset-govtrack-2c8e196100b12b0b8d6c53f6c945d8b98aab7c7a23621fd5a7d72d53>; 45 | void:triples 130005; 46 | void:uriSpace "http://logd.tw.rpi.edu/source/data-gov/dataset/4383/version/2011-Nov-29/"; 47 | pim:preferredURI ; 48 | dcat:distribution <#named-graph-c71c409f-2da1-4ec4-983c-63494963fdb6> . 49 | 50 | -------------------------------------------------------------------------------- /services/sadi/ckan/lift-ckan-materials/sample-inputs/two.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | 3 | 4 | a datafaqs:CKANDataset; 5 | datafaqs:ckan_identifier "instance-hub-fiscal-years"; 6 | . 7 | 8 | 9 | a datafaqs:CKANDataset; 10 | datafaqs:ckan_identifier "farmers-markets-geographic-data-united-states"; 11 | . 12 | -------------------------------------------------------------------------------- /services/sadi/contextual-inverse-functional/sample-inputs/myPa.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix : . 3 | 4 | :myPA dcterms:identifier "PA" . 5 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/by-reference/with-rdf-extension-materials/sample-inputs/hub-healthdata-gov.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | 3 | a dcat:Dataset . 4 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/by-reference/with-rdf-extension-materials/sample-inputs/hub-healthdata-gov.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix rdfs: . 3 | 4 | a datafaqs:WithReferences; 5 | rdfs:seeAlso . 6 | 7 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/sameas-org-materials/sameas-org-datafaqs.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/sameas-org-materials/sameas-org-datafaqs.ttl: -------------------------------------------------------------------------------- 1 | @prefix owl: . 2 | 3 | owl:sameAs . 4 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/sameas-org-materials/sample-inputs/edinburgh.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | 3 | a dcat:Dataset . 4 | 5 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/with-preferred-uri-and-ckan-meta-void-materials/sample-inputs/datafaqs-3-now-dcat.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | 3 | a ; 4 | dcterms:hasPart 5 | , 6 | , 7 | . 8 | 9 | a . 10 | a . 11 | a . 12 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/with-preferred-uri-and-ckan-meta-void-materials/sample-inputs/datafaqs-3.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | 3 | a ; 4 | dcterms:hasPart 5 | , 6 | , 7 | . 8 | 9 | a . 10 | a . 11 | a . 12 | -------------------------------------------------------------------------------- /services/sadi/core/augment-datasets/with-preferred-uri-and-ckan-meta-void-materials/sample-inputs/datafaqs-3.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | 3 | a ; 4 | rdfs:seeAlso . 5 | 6 | a ; 7 | rdfs:seeAlso , 8 | . 9 | 10 | a . 11 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-group-materials/sample-inputs/datahubio-datafaqs.ttl: -------------------------------------------------------------------------------- 1 | a . 2 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-group-materials/sample-inputs/datahubio-lodcloud.ttl: -------------------------------------------------------------------------------- 1 | a . 2 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-installation-materials/sample-inputs/healthdata-gov.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | 3 | a datafaqs:CKAN . 4 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-installation-materials/sample-inputs/healthdata-tw-rpi-edu.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | 3 | a datafaqs:CKAN . 4 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-tag-materials/sample-inputs/ckan-lifesciences.ttl: -------------------------------------------------------------------------------- 1 | @prefix moat: . 2 | 3 | 4 | moat:name "lifesciences" ; 5 | a moat:Tag . 6 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-tag-materials/sample-inputs/ckan-lod-helpme.ttl: -------------------------------------------------------------------------------- 1 | @prefix moat: . 2 | 3 | 4 | moat:name "lod" ; 5 | a moat:Tag . 6 | 7 | 8 | moat:name "helpme" ; 9 | a moat:Tag . 10 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-tag-materials/sample-inputs/ckan-lod.ttl: -------------------------------------------------------------------------------- 1 | @prefix moat: . 2 | 3 | 4 | moat:name "lod" ; 5 | a moat:Tag . 6 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-tag-materials/sample-inputs/ckan-provenance-metadata.ttl: -------------------------------------------------------------------------------- 1 | @prefix moat: . 2 | 3 | 4 | moat:name "provenance-metadata" ; 5 | a moat:Tag . 6 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/by-ckan-tag.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | <> 21 | prov:specializationOf . 22 | 23 | 24 | a datafaqs:DatasetSelector . 25 | 26 | [] 27 | a prov:Activity ; 28 | prov:hadQualifiedAttribution [ 29 | a prov:Attribution ; 30 | prov:adoptedPlan ; 31 | prov:hadQualifiedEntity 32 | ] . 33 | 34 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/drug-molecules-with-datahub.rq: -------------------------------------------------------------------------------- 1 | # http://srvgal78.deri.ie:8080/sparql.jsp hits http://srvgal78.deri.ie:8080/granatum/query with: 2 | 3 | prefix void: 4 | prefix rdfs: 5 | prefix dcat: 6 | 7 | construct { 8 | ?databugSp a void:Dataset ; 9 | a dcat:Dataset; 10 | void:sparqlEndpoint ?sparqlEndpoint . 11 | } 12 | 13 | where { 14 | service { 15 | ?sparqlEndpoint void:class ?class . 16 | ?class rdfs:label ?classLabel . 17 | } 18 | filter regex(?classLabel, "compound|molecule|drug", "i") 19 | 20 | service { 21 | ?dataset void:sparqlEndpoint ?sparqlEndpoint . 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/drug-molecules.rq: -------------------------------------------------------------------------------- 1 | # http://srvgal78.deri.ie:8080/sparql.jsp hits http://srvgal78.deri.ie:8080/granatum/query with: 2 | 3 | prefix void: 4 | prefix rdfs: 5 | prefix dcat: 6 | construct { 7 | ?sparqlEndpoint a void:Dataset ; a dcat:Dataset ; void:sparqlEndpoint ?sparqlEndpoint . 8 | } 9 | where { 10 | 11 | service { 12 | ?sparqlEndpoint void:class ?class . 13 | ?class rdfs:label ?classLabel . 14 | } 15 | filter regex(?classLabel, "compound|molecule|drug", "i") 16 | 17 | } 18 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/drug-molecules.sh: -------------------------------------------------------------------------------- 1 | rapper -q -g -o turtle 'http://srvgal78.deri.ie:8080/granatum/query?query=%23%20http%3A%2F%2Fsrvgal78.deri.ie%3A8080%2Fsparql.jsp%20hits%20http%3A%2F%2Fsrvgal78.deri.ie%3A8080%2Fgranatum%2Fquery%20with%3A%0D%0A%0D%0Aprefix%20void%3A%20%3Chttp%3A%2F%2Frdfs.org%2Fns%2Fvoid%23%3E%0D%0Aprefix%20rdfs%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0Aprefix%20dcat%3A%20%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Fdcat%23%3E%0D%0Aconstruct%20%7B%0D%0A%3FsparqlEndpoint%20a%20void%3ADataset%20%3B%20a%20dcat%3ADataset%20%3B%20void%3AsparqlEndpoint%20%3FsparqlEndpoint%20.%0D%0A%7D%0D%0Awhere%20%7B%0D%0A%0D%0Aservice%20%3Chttp%3A%2F%2Fhcls.deri.org%3A8080%2Fopenrdf-sesame%2Frepositories%2Fmemory%3E%20%7B%0D%0A%3FsparqlEndpoint%20void%3Aclass%20%3Fclass%20.%0D%0A%3Fclass%20rdfs%3Alabel%20%3FclassLabel%20.%0D%0A%7D%0D%0Afilter%20regex%28%3FclassLabel%2C%20%22compound%7Cmolecule%7Cdrug%22%2C%20%22i%22%29%0D%0A%0D%0A%7D%0D%0A' > drug-molecules.ttl 2 | rapper -g -c drug-molecules.ttl 3 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/drug-molecules.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix efo: . 3 | @prefix dcat: . 4 | @prefix drugbank: . 5 | @prefix void: . 6 | @prefix b2rpubchem: . 7 | @prefix foaf: . 8 | @prefix owl: . 9 | @prefix dc: . 10 | @prefix xsd: . 11 | @prefix granatum: . 12 | @prefix rdfs: . 13 | @prefix s3db: . 14 | 15 | 16 | void:sparqlEndpoint ; 17 | a void:Dataset, dcat:Dataset . 18 | 19 | 20 | void:sparqlEndpoint ; 21 | a void:Dataset, dcat:Dataset . 22 | 23 | 24 | void:sparqlEndpoint ; 25 | a void:Dataset, dcat:Dataset . 26 | 27 | 28 | void:sparqlEndpoint ; 29 | a void:Dataset, dcat:Dataset . 30 | 31 | 32 | void:sparqlEndpoint ; 33 | a void:Dataset, dcat:Dataset . 34 | 35 | 36 | void:sparqlEndpoint ; 37 | a void:Dataset, dcat:Dataset . 38 | 39 | 40 | void:sparqlEndpoint ; 41 | a void:Dataset, dcat:Dataset . 42 | 43 | 44 | void:sparqlEndpoint ; 45 | a void:Dataset, dcat:Dataset . 46 | 47 | 48 | void:sparqlEndpoint ; 49 | a void:Dataset, dcat:Dataset . 50 | 51 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/drug-molecules.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix void: . 3 | 4 | a void:Dataset, 5 | dcat:Dataset . 6 | 7 | a void:Dataset, 8 | dcat:Dataset . 9 | 10 | a void:Dataset, 11 | dcat:Dataset . 12 | 13 | a void:Dataset, 14 | dcat:Dataset . 15 | 16 | a void:Dataset, 17 | dcat:Dataset . 18 | 19 | a void:Dataset, 20 | dcat:Dataset . 21 | 22 | a void:Dataset, 23 | dcat:Dataset . 24 | 25 | a void:Dataset, 26 | dcat:Dataset . 27 | 28 | a void:Dataset, 29 | dcat:Dataset . 30 | 31 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity-materials/sample-inputs/logd.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix conversion: . 3 | 4 | 5 | a conversion:VersionedDataset, dcat:Dataset . 6 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/identity.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import re 7 | import sadi 8 | from rdflib import * 9 | import surf 10 | 11 | from surf import * 12 | from surf.query import select 13 | 14 | # These are the namespaces we are using beyond those already available 15 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 16 | ns.register(void='http://rdfs.org/ns/void#') 17 | ns.register(dcat='http://www.w3.org/ns/dcat#') 18 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 19 | 20 | # The Service itself 21 | class IdentityDatasetSelector(faqt.Service): 22 | 23 | # Service metadata. 24 | label = 'dataset-identity' 25 | serviceDescriptionText = 'Return the same dcat:Datasets given to this service (the identity function).' 26 | comment = '' 27 | serviceNameText = 'identity-dataset' # Convention: Match 'name' below. 28 | name = 'identity-dataset' # This value determines the service URI relative to http://localhost:9090/ 29 | # Convention: Use the name of this file for this value. 30 | dev_port = 9108 31 | 32 | def __init__(self): 33 | faqt.Service.__init__(self, servicePath = 'services/sadi/core/select-datasets') 34 | 35 | def getOrganization(self): 36 | result = self.Organization() 37 | result.mygrid_authoritative = True 38 | result.protegedc_creator = 'lebot@rpi.edu' 39 | result.save() 40 | return result 41 | 42 | def getInputClass(self): 43 | return ns.DCAT['Dataset'] 44 | 45 | def getOutputClass(self): 46 | return ns.DCAT['Dataset'] 47 | 48 | def process(self, input, output): 49 | 50 | print input.subject 51 | 52 | for type in input.rdf_type: 53 | output.rdf_type.append(type) 54 | 55 | output.save() 56 | 57 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 58 | resource = IdentityDatasetSelector() 59 | 60 | # Used when this service is manually invoked from the command line (for testing). 61 | if __name__ == '__main__': 62 | print resource.name + ' running on port ' + str(resource.dev_port) + '. Invoke it with:' 63 | print 'curl -H "Content-Type: text/turtle" -d @my.ttl http://localhost:' + str(resource.dev_port) + '/' + resource.name 64 | sadi.publishTwistedService(resource, port=resource.dev_port) 65 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/conversion_AbstractDatasets.rq: -------------------------------------------------------------------------------- 1 | prefix conversion: 2 | 3 | select distinct ?dataset 4 | where { 5 | ?dataset a conversion:AbstractDataset 6 | } 7 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/conversion_AbstractDatasets.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix sd: . 4 | @prefix datafaqs: . 5 | @prefix : . 6 | 7 | :apply 8 | a datafaqs:QueryToApply; 9 | datafaqs:query ; 10 | datafaqs:dataset :dataset; 11 | . 12 | 13 | 14 | a datafaqs:SPARQLQuery; 15 | rdfs:comment "One could resolve the URI for this query, or use the given rdf:value"; 16 | rdf:value 17 | """prefix conversion: 18 | 19 | select distinct ?dataset 20 | where { 21 | ?dataset a conversion:AbstractDataset 22 | } 23 | """; 24 | . 25 | 26 | :dataset 27 | a sd:Dataset; 28 | rdfs:comment "We want to query the entire endpoint."; 29 | . 30 | 31 | :sparql-service 32 | a sd:Service; 33 | sd:availableGraphDescriptions :dataset; 34 | sd:endpoint ; 35 | . 36 | #3> <> prov:wasGeneratedBy [ 37 | #3> dcterms:description "df-SPARQLQuery.py conversion_AbstractDatasets.rq@http://aquarius.tw.rpi.edu/projects/healthdata/sparql"; 38 | #3> prov:qualifiedAssociation [ 39 | #3> a prov:Association; 40 | #3> prov:hadPlan ; 41 | #3> ]; 42 | #3> ]; . 43 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/csv2rdf4lod-dataset-samples-in-endpoint.rq: -------------------------------------------------------------------------------- 1 | prefix conversion: 2 | select distinct ?sample 3 | where { 4 | graph ?sample { 5 | ?sample a conversion:DatasetSample . 6 | ?layer 7 | void:subset ?sample; 8 | conversion:conversion_identifier ?id . 9 | filter(?id != 'raw') 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/csv2rdf4lod-dataset-samples-in-endpoint.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix sd: . 4 | @prefix datafaqs: . 5 | @prefix : . 6 | 7 | :apply 8 | a datafaqs:QueryToApply; 9 | datafaqs:query ; 10 | datafaqs:dataset :dataset; 11 | . 12 | 13 | 14 | a datafaqs:SPARQLQuery; 15 | rdfs:comment "One could resolve the URI for this query, or use the given rdf:value"; 16 | rdf:value 17 | """prefix conversion: 18 | select distinct ?sample 19 | where { 20 | graph ?sample { 21 | ?sample a conversion:DatasetSample . 22 | ?layer 23 | void:subset ?sample; 24 | conversion:conversion_identifier ?id . 25 | filter(?id != 'raw') 26 | } 27 | }"""; 28 | . 29 | 30 | :dataset 31 | a sd:Dataset; 32 | rdfs:comment "We want to query the entire endpoint."; 33 | . 34 | 35 | :logd-sparql-service 36 | a sd:Service; 37 | sd:availableGraphDescriptions :dataset; 38 | sd:endpoint ; 39 | . 40 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/logd-converted-datasets-with-samples.rq: -------------------------------------------------------------------------------- 1 | prefix void: 2 | prefix conversion: 3 | 4 | select distinct ?dataset ?type 5 | where { 6 | graph ?sample { 7 | ?sample a conversion:DatasetSample . 8 | ?dataset 9 | a conversion:AbstractDataset, ?type; 10 | void:subset [ 11 | void:subset [ 12 | void:subset ?sample 13 | ] 14 | ] 15 | } 16 | } order by ?dataset 17 | -------------------------------------------------------------------------------- /services/sadi/core/select-datasets/via-sparql-query-materials/sample-inputs/logd-converted-datasets-with-samples.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix sd: . 4 | @prefix datafaqs: . 5 | @prefix : . 6 | 7 | :apply 8 | a datafaqs:QueryToApply; 9 | datafaqs:query ; 10 | datafaqs:dataset :dataset; 11 | . 12 | 13 | 14 | a datafaqs:SPARQLQuery; 15 | rdfs:comment "One could resolve the URI for this query, or use the given rdf:value"; 16 | rdf:value 17 | """prefix void: 18 | prefix conversion: 19 | 20 | select distinct ?dataset ?type 21 | where { 22 | graph ?sample { 23 | ?sample a conversion:DatasetSample . 24 | ?dataset 25 | a conversion:AbstractDataset, ?type; 26 | void:subset [ 27 | void:subset [ 28 | void:subset ?sample 29 | ] 30 | ] 31 | } 32 | } order by ?dataset"""; 33 | . 34 | 35 | :dataset 36 | a sd:Dataset; 37 | rdfs:comment "We want to query the entire endpoint."; 38 | . 39 | 40 | :logd-sparql-service 41 | a sd:Service; 42 | sd:availableGraphDescriptions :dataset; 43 | sd:endpoint ; 44 | . 45 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity-materials/sample-inputs/max-1-topic-tag.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | a datafaqs:FAqTService . 3 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity-materials/sample-inputs/redirect-loop.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | a datafaqs:FAqTService . 3 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity-materials/sample-inputs/void-triples.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | a datafaqs:FAqTService . 3 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import re 7 | import sadi 8 | from rdflib import * 9 | import surf 10 | 11 | from surf import * 12 | from surf.query import select 13 | 14 | # These are the namespaces we are using beyond those already available 15 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 16 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 17 | 18 | # The Service itself 19 | class IdentityFAqTService(faqt.Service): 20 | 21 | # Service metadata. 22 | label = 'identity' 23 | serviceDescriptionText = 'Return the FAqT services given.' 24 | comment = '' 25 | serviceNameText = 'identity' # Convention: Match 'name' below. 26 | name = 'identity' # This value determines the service URI relative to http://localhost:9090/ 27 | # Convention: Use the name of this file for this value. 28 | def __init__(self): 29 | faqt.Service.__init__(self, servicePath = 'services/sadi/core/select-faqts') 30 | 31 | def getOrganization(self): 32 | result = self.Organization() 33 | result.mygrid_authoritative = True 34 | result.protegedc_creator = 'lebot@rpi.edu' 35 | result.save() 36 | return result 37 | 38 | def getInputClass(self): 39 | return ns.DATAFAQS['FAqTService'] 40 | 41 | def getOutputClass(self): 42 | return ns.DATAFAQS['FAqTServiceCollection'] 43 | 44 | def process(self, input, output): 45 | 46 | print input.subject 47 | 48 | #FAqTService = output.session.get_class(ns.DATAFAQS['FAqTService']) 49 | #faqt_service = output.session.get_resource(output.subject,ns.DATAFAQS['FAqTService']) #FAqTService(output.subject) 50 | #faqt_service.rdf_type.append(ns.DATAFAQS['FAqTService']) 51 | #faqt_service.save() 52 | 53 | output.rdf_type.append(ns.DATAFAQS['FAqTService']) 54 | output.dcterms_hasPart.append(output) 55 | 56 | output.save() 57 | 58 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 59 | resource = IdentityFAqTService() 60 | 61 | # Used when this service is manually invoked from the command line (for testing). 62 | if __name__ == '__main__': 63 | port = 9105 64 | print 'curl -H "Content-Type: text/turtle" -d @my.ttl http://localhost:' + str(port) + '/' + resource.name 65 | sadi.publishTwistedService(resource, port=port) 66 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity0-materials/sample-inputs/named-graphs-a-mygrid.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix mygrid: . 4 | @prefix j.0: . 5 | @prefix rdfs: . 6 | 7 | <> 8 | mygrid:hasOperation [ 9 | mygrid:inputParameter [ 10 | mygrid:objectType ; 11 | a mygrid:parameter 12 | ] ; 13 | mygrid:outputParameter [ 14 | mygrid:objectType ; 15 | a mygrid:parameter 16 | ] ; 17 | a mygrid:operation 18 | ] ; 19 | mygrid:hasServiceNameText "named-graphs"^^ ; 20 | mygrid:providedBy [ 21 | j.0:creator "lebot@rpi.edu"^^ ; 22 | mygrid:authoritative false ; 23 | a mygrid:organisation 24 | ] ; 25 | a mygrid:serviceDescription ; 26 | rdfs:label "named-graphs"^^ . 27 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/identity0.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import re 7 | import sadi 8 | from rdflib import * 9 | import surf 10 | 11 | from surf import * 12 | from surf.query import select 13 | 14 | # These are the namespaces we are using beyond those already available 15 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 16 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 17 | ns.register(mygrid='http://www.mygrid.org.uk/mygrid-moby-service#') 18 | 19 | # The Service itself 20 | class IdentityFAqTService(faqt.Service): 21 | 22 | # Service metadata. 23 | label = 'identity0' 24 | serviceDescriptionText = 'Return the FAqT services given.' 25 | comment = '' 26 | serviceNameText = 'identity0' # Convention: Match 'name' below. 27 | name = 'identity0' # This value determines the service URI relative to http://localhost:9090/ 28 | # Convention: Use the name of this file for this value. 29 | def __init__(self): 30 | faqt.Service.__init__(self, servicePath = 'services/sadi/core/select-faqts') 31 | 32 | def getOrganization(self): 33 | result = self.Organization() 34 | result.mygrid_authoritative = True 35 | result.protegedc_creator = 'lebot@rpi.edu' 36 | result.save() 37 | return result 38 | 39 | def getInputClass(self): 40 | return ns.MYGRID['serviceDescription'] 41 | 42 | def getOutputClass(self): 43 | return ns.DATAFAQS['FAqTServiceCollection'] 44 | 45 | def process(self, input, output): 46 | 47 | print input.subject 48 | 49 | #FAqTService = output.session.get_class(ns.DATAFAQS['FAqTService']) 50 | #faqt_service = output.session.get_resource(output.subject,ns.DATAFAQS['FAqTService']) #FAqTService(output.subject) 51 | #faqt_service.rdf_type.append(ns.DATAFAQS['FAqTService']) 52 | #faqt_service.save() 53 | 54 | output.rdf_type.append(ns.DATAFAQS['FAqTService']) 55 | output.dcterms_hasPart.append(output) 56 | 57 | output.save() 58 | 59 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 60 | resource = IdentityFAqTService() 61 | 62 | # Used when this service is manually invoked from the command line (for testing). 63 | if __name__ == '__main__': 64 | port = 9105 65 | print 'curl -H "Content-Type: text/turtle" -d @my.ttl http://localhost:' + str(port) + '/' + resource.name 66 | sadi.publishTwistedService(resource, port=port) 67 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/towards/ckan-group-materials/sample-inputs/ckan-lodcloud.ttl: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | 3 | 4 | a datafaqs:CKANGroup; 5 | datafaqs:ckan_identifier "lodcloud"; 6 | . 7 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/via-sparql-query-materials/sample-inputs/from-official-sadi-registry.rq: -------------------------------------------------------------------------------- 1 | # apply against http://biordf.net/sparql 2 | 3 | prefix moby: 4 | prefix void: 5 | prefix datafaqs: 6 | 7 | select distinct ?service 8 | where { 9 | graph { 10 | ?service 11 | moby:hasOperation [ 12 | a moby:operation; 13 | moby:inputParameter [ 14 | moby:objectType void:Dataset; 15 | ]; 16 | moby:outputParameter [ 17 | moby:objectType datafaqs:EvaluatedDataset; 18 | ] 19 | ] 20 | . 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/via-sparql-query-materials/sample-inputs/from-official-sadi-registry.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix sd: . 4 | @prefix datafaqs: . 5 | @prefix : . 6 | 7 | :apply 8 | a datafaqs:QueryToApply; 9 | datafaqs:query ; 10 | datafaqs:dataset :dataset; 11 | . 12 | 13 | 14 | a datafaqs:SPARQLQuery; 15 | rdfs:comment "One could resolve the URI for this query, or use the given rdf:value"; 16 | rdf:value 17 | """prefix moby: 18 | prefix void: 19 | prefix datafaqs: 20 | 21 | select distinct ?service 22 | where { 23 | graph { 24 | ?service 25 | moby:hasOperation [ 26 | a moby:operation; 27 | moby:inputParameter [ 28 | moby:objectType void:Dataset; 29 | ]; 30 | moby:outputParameter [ 31 | moby:objectType datafaqs:EvaluatedDataset; 32 | ] 33 | ] 34 | . 35 | } 36 | }"""; 37 | . 38 | 39 | :dataset 40 | a sd:Dataset; 41 | sd:namedGraph :graph; 42 | . 43 | 44 | :graph 45 | a sd:NamedGraph; 46 | sd:name ; 47 | . 48 | 49 | :bionet-sparql-service 50 | a sd:Service; 51 | sd:availableGraphDescriptions :dataset; 52 | sd:endpoint ; 53 | . 54 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/via-sparql-query.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | 21 | a datafaqs:FAqTService . 22 | 23 | 24 | foaf:homepage . 25 | 26 | <> 27 | rdfs:seeAlso ; 28 | prov:specializationOf . 29 | 30 | [] 31 | a prov:Activity ; 32 | prov:hadQualifiedAttribution [ 33 | a prov:Attribution ; 34 | prov:adoptedPlan ; 35 | prov:hadQualifiedEntity 36 | ] . 37 | 38 | -------------------------------------------------------------------------------- /services/sadi/core/select-faqts/visko-planner-materials/sample-inputs/manylines.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix pmlp: . 3 | @prefix dcat: . 4 | @prefix prov: . 5 | @prefix frbr: . 6 | @prefix : . 7 | 8 | :what-I-want 9 | a :Objective, dcat:Dataset; 10 | rdfs:comment "I want to see this .ps file in Firefox"; 11 | prov:wasDerivedFrom ; 12 | prov:alternateOf ; 13 | :viewableIn ; 14 | . 15 | 16 | 17 | a prov:Work; 18 | pmlp:hasFormat ; 19 | . 20 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/in-sparql-endpoint-materials/sample-inputs/1-good-1-bad-from-lodstat.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix datafaqs: . 3 | 4 | a dcat:Dataset . 5 | a dcat:Dataset . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/in-sparql-endpoint.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | 21 | a datafaqs:FAqTService . 22 | 23 | <> 24 | prov:specializationOf . 25 | 26 | [] 27 | a prov:Activity ; 28 | prov:hadQualifiedAttribution [ 29 | a prov:Attribution ; 30 | prov:adoptedPlan ; 31 | prov:hadQualifiedEntity 32 | ] . 33 | 34 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/lena-example-materials/sample-inputs/chebi-endpoint.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix void: . 3 | 4 | 5 | a dcat:Dataset, void:Dataset; 6 | void:sparqlEndpoint ; 7 | . 8 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/lena-example.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix sd: . 15 | @prefix moby: . 16 | @prefix conversion: . 17 | @prefix datafaqs: . 18 | @prefix dbpedia: . 19 | @prefix prov: . 20 | @prefix twi: . 21 | 22 | 23 | a datafaqs:FAqTService . 24 | 25 | 26 | foaf:homepage . 27 | 28 | <> 29 | rdfs:seeAlso ; 30 | prov:specializationOf . 31 | 32 | [] 33 | a prov:Activity ; 34 | prov:hadQualifiedAttribution [ 35 | a prov:Attribution ; 36 | prov:adoptedPlan ; 37 | prov:hadQualifiedEntity 38 | ] . 39 | 40 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-datadump-materials/sample-inputs/iogds.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix void: . 3 | 4 | 5 | a dcat:Dataset; 6 | void:dataDump ; 7 | . 8 | 9 | 10 | a dcat:Dataset; 11 | void:dataDump ; 12 | . 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-datadump-materials/sample-inputs/iogds.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix http: . 3 | @prefix rdfs: . 4 | @prefix void: . 5 | @prefix xsd: . 6 | 7 | a datafaqs:Unsatisfactory; 8 | void:dataDump . 9 | 10 | a datafaqs:Satisfactory; 11 | void:dataDump . 12 | 13 | a rdfs:Resource; 14 | http:statusCodeValue 404 . 15 | 16 | a rdfs:Resource; 17 | http:statusCodeValue 200 . 18 | 19 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-subset-tree-dumps/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .classpath 3 | .project 4 | .settings 5 | *.iml 6 | *~ 7 | 8 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-subset-tree-dumps/README.txt: -------------------------------------------------------------------------------- 1 | # Build the service 2 | mvn clean install 3 | 4 | # Start the service 5 | ./start.sh 6 | 7 | # Issue a request to the service locally 8 | wget --header "Content-type: text/turtle" --post-file sample-inputs/post.ttl http://localhost:9119/check 9 | 10 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-subset-tree-dumps/sample-inputs/post.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix datafaqs: . 3 | @prefix void: . 4 | @prefix owl: . 5 | @prefix con: . 6 | 7 | 8 | rdf:type void:Dataset, datafaqs:FAqTBrick; 9 | void:subset , 10 | , 11 | , 12 | . 13 | 14 | rdf:type datafaqs:Epoch . 15 | rdf:type datafaqs:Epoch . 16 | rdf:type datafaqs:Epoch . 17 | rdf:type datafaqs:Epoch . 18 | rdf:type datafaqs:Epoch . 19 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-subset-tree-dumps/src/main/java/tw/rpi/edu/datafaqs/treedumps/TreeDumpsRippleService.java: -------------------------------------------------------------------------------- 1 | package tw.rpi.edu.datafaqs.treedumps; 2 | 3 | import org.restlet.Component; 4 | import org.restlet.data.Protocol; 5 | import org.restlet.routing.VirtualHost; 6 | 7 | /** 8 | * @author Joshua Shinavier (http://fortytwo.net) 9 | */ 10 | public class TreeDumpsRippleService { 11 | 12 | public TreeDumpsRippleService() throws Exception { 13 | // https://github.com/timrdf/DataFAQs/wiki/FAqT-Service 14 | int serverPort = 9119; 15 | 16 | Component component = new Component(); 17 | component.getServers().add(Protocol.HTTP, serverPort); 18 | 19 | VirtualHost host = component.getDefaultHost(); 20 | 21 | host.attach("/check", new DumpResource()); 22 | 23 | component.start(); 24 | } 25 | 26 | public static void main(final String[] args) throws Exception { 27 | new TreeDumpsRippleService(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /services/sadi/faqt/access/void-subset-tree-dumps/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Find Java 4 | if [ "$JAVA_HOME" = "" ] ; then 5 | JAVA="java" 6 | else 7 | JAVA="$JAVA_HOME/bin/java" 8 | fi 9 | 10 | # Set Java options 11 | if [ "$JAVA_OPTIONS" = "" ] ; then 12 | JAVA_OPTIONS="-Xms32M -Xmx512M" 13 | fi 14 | 15 | DIR=`dirname $0` 16 | 17 | # Launch the application 18 | $JAVA $JAVA_OPTIONS -cp $DIR/target/classes:$DIR/"target/dependency/*" tw.rpi.edu.datafaqs.treedumps.TreeDumpsRippleService $* 19 | 20 | # Return the program's exit code 21 | exit $? 22 | -------------------------------------------------------------------------------- /services/sadi/faqt/completeness-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/completeness.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | <> 21 | prov:specializationOf . 22 | 23 | 24 | a datafaqs:FAqTService . 25 | 26 | 27 | dcterms:created "Jan 27, 2012" . 28 | 29 | [] 30 | a prov:Activity ; 31 | prov:hadQualifiedAttribution [ 32 | a prov:Attribution ; 33 | prov:adoptedPlan ; 34 | prov:hadQualifiedEntity 35 | ] . 36 | 37 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g0.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | @prefix sd: . 3 | @prefix : . 4 | 5 | :service 6 | a sd:Service; 7 | sd:endpoint ; 8 | sd:availableGraphs :collection; 9 | . 10 | :collection 11 | a sd:GraphCollection; 12 | sd:namedGraph :named-graph-1, :named-graph-2, :named-graph-meta; 13 | . 14 | 15 | :named-graph-1 16 | a sd:NamedGraph; 17 | sd:name ; 18 | sd:graph :graph-1; 19 | . 20 | :graph-1 21 | a sd:Graph, void:Dataset; 22 | void:triples 1; 23 | void:dataDump ; 24 | . 25 | 26 | :named-graph-2 27 | a sd:NamedGraph; 28 | sd:name ; 29 | sd:graph :graph-2; 30 | . 31 | :graph-2 32 | a sd:Graph, void:Dataset; 33 | void:triples 1; 34 | void:dataDump ; 35 | . 36 | 37 | :named-graph-meta 38 | a sd:NamedGraph; 39 | sd:name ; 40 | sd:graph :graph-meta; 41 | . 42 | :graph-meta 43 | a sd:Graph, void:Dataset; 44 | void:triples 28; 45 | void:dataDump ; 46 | . 47 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g0.ttl.sd_name: -------------------------------------------------------------------------------- 1 | http://example.org/graphs 2 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g1.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | foaf:based_near . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g1.ttl.sd_name: -------------------------------------------------------------------------------- 1 | http://example.org/graphs/1 2 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g2.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | foaf:based_near . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/nquad-graph-materials/prototype-1/g2.ttl.sd_name: -------------------------------------------------------------------------------- 1 | http://example.org/graphs/2 2 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/references-instance-hub-materials/sample-inputs/tobacco.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | 3 | 4 | a dcat:Dataset . 5 | 6 | a dcat:Dataset . 7 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/references-instance-hub.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix sd: . 15 | @prefix moby: . 16 | @prefix conversion: . 17 | @prefix datafaqs: . 18 | @prefix dbpedia: . 19 | @prefix prov: . 20 | @prefix twi: . 21 | 22 | 23 | a datafaqs:FAqTService . 24 | 25 | 26 | foaf:homepage . 27 | 28 | <> 29 | rdfs:seeAlso ; 30 | prov:specializationOf . 31 | 32 | [] 33 | a prov:Activity ; 34 | prov:qualifiedAttribution [ 35 | a prov:Attribution ; 36 | prov:entity ; 37 | prov:hadPlan 38 | ] . 39 | 40 | -------------------------------------------------------------------------------- /services/sadi/faqt/connected/void-linkset-materials/linkset.rq: -------------------------------------------------------------------------------- 1 | prefix void: 2 | 3 | select ?from ?to ?overlap 4 | where { 5 | ?from void:subset [ 6 | a void:Linkset; 7 | void:target ?from, 8 | ?to; 9 | void:triples ?overlap; 10 | ] . 11 | filter( ?from != ?to ) 12 | } 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/consistensy-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/datascape/size-materials/sample-inputs/1000.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix void: . 3 | @prefix xsd: . 4 | 5 | a datafaqs:Satisfactory; 6 | void:triples 1001 . 7 | 8 | a datafaqs:Unsatisfactory; 9 | void:triples 999 . 10 | 11 | -------------------------------------------------------------------------------- /services/sadi/faqt/datascape/size-materials/sample-inputs/1000.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix dcat: . 3 | @prefix datafaqs: . 4 | @prefix void: . 5 | @prefix xsd: . 6 | @prefix ns1: . 7 | 8 | 9 | void:triples 1001 ; 10 | a dcat:Dataset . 11 | 12 | 13 | void:triples 999 ; 14 | a dcat:Dataset . 15 | 16 | -------------------------------------------------------------------------------- /services/sadi/faqt/datascape/size.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf <#TEMPLATE/path/to/public/source-code.rpy>; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import sadi 7 | from rdflib import * 8 | import surf 9 | 10 | from surf import * 11 | from surf.query import select 12 | 13 | import rdflib 14 | rdflib.plugin.register('sparql', rdflib.query.Processor, 15 | 'rdfextras.sparql.processor', 'Processor') 16 | rdflib.plugin.register('sparql', rdflib.query.Result, 17 | 'rdfextras.sparql.query', 'SPARQLQueryResult') 18 | 19 | import httplib 20 | from urlparse import urlparse, urlunparse 21 | import urllib 22 | import urllib2 23 | 24 | # These are the namespaces we are using beyond those already available 25 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 26 | ns.register(moat='http://moat-project.org/ns#') 27 | ns.register(ov='http://open.vocab.org/terms/') 28 | ns.register(void='http://rdfs.org/ns/void#') 29 | ns.register(dcat='http://www.w3.org/ns/dcat#') 30 | ns.register(sd='http://www.w3.org/ns/sparql-service-description#') 31 | ns.register(conversion='http://purl.org/twc/vocab/conversion/') 32 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 33 | 34 | # The Service itself 35 | class Size(faqt.Service): 36 | 37 | # Service metadata. 38 | label = 'size' 39 | serviceDescriptionText = '' 40 | comment = '' 41 | serviceNameText = 'size' # Convention: Match 'name' below. 42 | name = 'size' # This value determines the service URI relative to http://localhost:9090/ 43 | # Convention: Use the name of this file for this value. 44 | dev_port = 9223 45 | 46 | def __init__(self): 47 | faqt.Service.__init__(self, servicePath = 'services/sadi/faqt/datascape') 48 | 49 | def getOrganization(self): 50 | result = self.Organization() 51 | result.mygrid_authoritative = True 52 | result.protegedc_creator = 'lebot@rpi.edu' 53 | result.save() 54 | return result 55 | 56 | def getInputClass(self): 57 | return ns.DCAT['Dataset'] 58 | 59 | def getOutputClass(self): 60 | return ns.DATAFAQS['EvaluatedDataset'] 61 | 62 | def process(self, input, output): 63 | 64 | print 'processing ' + input.subject + ' ' + str(len(input.void_triples)) 65 | 66 | if len(input.void_triples) > 0: 67 | output.void_triples = input.void_triples.first 68 | if int(input.void_triples.first) > 1000: 69 | output.rdf_type.append(ns.DATAFAQS['Satisfactory']) 70 | else: 71 | output.rdf_type.append(ns.DATAFAQS['Unsatisfactory']) 72 | 73 | output.save() 74 | 75 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 76 | resource = Size() 77 | 78 | # Used when this service is manually invoked from the command line (for testing). 79 | if __name__ == '__main__': 80 | print resource.name + ' running on port ' + str(resource.dev_port) + '. Invoke it with:' 81 | print 'curl -H "Content-Type: text/turtle" -d @my.ttl http://localhost:' + str(resource.dev_port) + '/' + resource.name 82 | sadi.publishTwistedService(resource, port=resource.dev_port) 83 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/contributor-email-materials/sample-inputs/ckan-aemet.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix oo: . 4 | 5 | a ; 6 | dcterms:contributor ; 7 | oo:corrections "mailto:test@example.com" . 8 | 9 | a ; 10 | foaf:mbox "mailto:dgarijov@gmail.com" . 11 | 12 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/contributor-email.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | <> 21 | prov:specializationOf . 22 | 23 | 24 | a datafaqs:FAqTService . 25 | 26 | [] 27 | a prov:Activity ; 28 | prov:hadQualifiedAttribution [ 29 | a prov:Attribution ; 30 | prov:adoptedPlan ; 31 | prov:hadQualifiedEntity 32 | ] . 33 | 34 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/groups-materials/sample-inputs/w3-org.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Site . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-apr-0000.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix sioc: . 3 | 4 | a sioc:Item . 5 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-apr-0000.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix sioc: . 4 | 5 | a datafaqs:Satisfactory, 6 | sioc:Item; 7 | dcterms:date "Thu, 14 Apr 2011 12:32:28 +0200"; 8 | dcterms:identifier "4DA6CD3C.8050100@gmail.com"; 9 | sioc:next_by_date . 10 | 11 | a sioc:Item . 12 | 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0000.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix sioc: . 3 | 4 | a sioc:Item . 5 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0000.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix lists: . 4 | @prefix sioc: . 5 | 6 | a datafaqs:Satisfactory, 7 | sioc:Item; 8 | lists:maybe_reply , 9 | , 10 | ; 11 | lists:next_in_thread ; 12 | dcterms:date "Mon, 01 Aug 2011 09:00:58 +0100"; 13 | dcterms:identifier "EMEW3|e9b7794993998b7a896b98f9563d32cdn7091108L.Moreau|ecs.soton.ac.uk|4E365D3A.8060808@ecs.soton.ac.uk"; 14 | sioc:has_reply , 15 | , 16 | , 17 | , 18 | , 19 | , 20 | , 21 | ; 22 | sioc:next_by_date ; 23 | sioc:reply_of . 24 | 25 | a sioc:Item . 26 | 27 | a sioc:Item . 28 | 29 | a sioc:Item . 30 | 31 | a sioc:Item . 32 | 33 | a sioc:Item . 34 | 35 | a sioc:Item . 36 | 37 | a sioc:Item . 38 | 39 | a sioc:Item . 40 | 41 | a sioc:Item . 42 | 43 | a sioc:Item . 44 | 45 | a sioc:Item . 46 | 47 | a sioc:Item . 48 | 49 | a sioc:Item . 50 | 51 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0014.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix sioc: . 3 | 4 | a sioc:Item; 5 | dcterms:description "has a To and CC"; 6 | . 7 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0014.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix lists: . 4 | @prefix sioc: . 5 | 6 | a sioc:Item . 7 | 8 | a datafaqs:Satisfactory, 9 | sioc:Item; 10 | lists:next_in_thread ; 11 | dcterms:date "Mon, 01 Aug 2011 17:18:34 +0200"; 12 | dcterms:identifier "4E36C3CA.1060905@vu.nl"; 13 | sioc:next_by_date ; 14 | sioc:previous_by_date . 15 | 16 | a sioc:Item . 17 | 18 | a sioc:Item . 19 | 20 | a sioc:Item . 21 | 22 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0049.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix sioc: . 3 | 4 | a sioc:Item; 5 | dcterms:author "Curt Tilmes"; 6 | dcterms:date "Tuesday, 2 August 2011"; 7 | dcterms:identifier "msg49"; 8 | sioc:has_container . 9 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/message-materials/sample-inputs/public-prov-wg-2011-aug-0049.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix lists: . 4 | @prefix sioc: . 5 | 6 | a datafaqs:Satisfactory, 7 | sioc:Item; 8 | lists:next_in_thread ; 9 | dcterms:date "Tue, 2 Aug 2011 11:53:40 -0400"; 10 | dcterms:identifier "4E381D84.4070209@nasa.gov"; 11 | sioc:next_by_date ; 12 | sioc:previous_by_date ; 13 | sioc:reply_of . 14 | 15 | a sioc:Item . 16 | 17 | a sioc:Item . 18 | 19 | a sioc:Item . 20 | 21 | a sioc:Item . 22 | 23 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/pso-pc.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-lod.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-opentag-contrib.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-prov-wg.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-rdf-prov.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-rdf-prov.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix datafaqs: . 2 | @prefix dcterms: . 3 | @prefix sioc: . 4 | @prefix xsd: . 5 | 6 | a sioc:Container; 7 | dcterms:date "October 2011"; 8 | sioc:has_space ; 9 | sioc:num_items 30 . 10 | 11 | a sioc:Container; 12 | dcterms:date "September 2011"; 13 | sioc:has_space ; 14 | sioc:num_items 27 . 15 | 16 | a sioc:Container; 17 | dcterms:date "June 2012"; 18 | sioc:has_space ; 19 | sioc:num_items 4 . 20 | 21 | a sioc:Container; 22 | dcterms:date "March 2012"; 23 | sioc:has_space ; 24 | sioc:num_items 1 . 25 | 26 | a datafaqs:Satisfactory . 27 | 28 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-group-materials/sample-inputs/public-rdf-wg.ttl: -------------------------------------------------------------------------------- 1 | @prefix sioc: . 2 | 3 | a sioc:Space . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-month-materials/sample-inputs/public-prov-wg-2012-jul-conservative.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix sioc: . 3 | @prefix hello: . 4 | 5 | a sioc:Container . 6 | 7 | [] a hello:SecondaryParameters; 8 | rdfs:comment "Do NOT assume that the authors name uniquely identifies the author"; 9 | hello:author_identification_stance hello:conservative . 10 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/per-month-materials/sample-inputs/public-prov-wg-2012-jul.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix sioc: . 3 | @prefix hello: . 4 | 5 | a sioc:Container . 6 | 7 | [] a hello:SecondaryParameters; 8 | rdfs:comment "assume that the authors name uniquely identifies the author"; 9 | hello:author_identification_stance hello:liberal . 10 | -------------------------------------------------------------------------------- /services/sadi/faqt/discuss/via-hypermail/readme.md: -------------------------------------------------------------------------------- 1 | See https://github.com/timrdf/prov-wg/wiki/public-prov-wg-mailing-list 2 | -------------------------------------------------------------------------------- /services/sadi/faqt/internet-domain.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import sadi 7 | from surf import * 8 | from urlparse import urlparse 9 | 10 | # These are the namespaces we are using beyond those already available 11 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 12 | ns.register(void='http://rdfs.org/ns/void#') 13 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 14 | #ns.register(datafaqs='http://sparql.tw.rpi.edu/test/datafaqs.owl#') 15 | 16 | # The Service itself 17 | class InternetDomain(faqt.Service): 18 | 19 | # Service metadata. 20 | label = 'internet-domain' 21 | serviceDescriptionText = 'Reports the internet domain of the URIs for the datasets given.' 22 | comment = '' 23 | serviceNameText = 'internet-domain' # Convention: Match 'name' below. 24 | name = 'internet-domain' # This value determines the service URI relative to http://localhost:9090/ 25 | # Convention: Use the name of this file for this value. 26 | def __init__(self): 27 | faqt.Service.__init__(self, servicePath = 'services/sadi/faqt') 28 | 29 | def getOrganization(self): 30 | result = self.Organization() 31 | result.mygrid_authoritative = True 32 | result.protegedc_creator = 'lebot@rpi.edu' 33 | result.save() 34 | return result 35 | 36 | def getInputClass(self): 37 | return ns.VOID['Dataset'] 38 | 39 | def getOutputClass(self): 40 | return ns.DATAFAQS['DatasetWithInternetDomain'] 41 | 42 | def process(self, input, output): 43 | parsed = urlparse(input.subject) 44 | output.datafaqs_internet_domain = parsed.scheme + parsed.netloc 45 | output.save() 46 | 47 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 48 | resource = InternetDomain() 49 | 50 | # Used when this service is manually invoked from the command line (for testing). 51 | if __name__ == '__main__': 52 | sadi.publishTwistedService(resource, port=9092) 53 | -------------------------------------------------------------------------------- /services/sadi/faqt/lodcloud/max-1-topic-tag-materials/sample-inputs/pass-and-fail.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | @prefix moat: . 3 | 4 | 5 | a void:Dataset; 6 | moat:taggedWithTag ; 7 | moat:taggedWithTag ; 8 | . 9 | 10 | 11 | a void:Dataset; 12 | moat:taggedWithTag ; 13 | . 14 | -------------------------------------------------------------------------------- /services/sadi/faqt/lodcloud/tagged-with-lod-materials/sample-inputs/pass-and-fail.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | @prefix datafaqs: . 3 | @prefix tag: . 4 | 5 | 6 | a datafaqs:CKANDataset; 7 | tag:taggedWithTag ; 8 | . 9 | 10 | 11 | a datafaqs:CKANDataset; 12 | . 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/lodcloud/tagged-with-lod-materials/sample-inputs/pass-and-fail.ttl.viajava: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/lodcloud/tagged-with-topic-materials/sample-inputs/pass-and-fail.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | @prefix datafaqs: . 3 | @prefix tag: . 4 | 5 | 6 | a datafaqs:CKANDataset; 7 | tag:taggedWithTag ; 8 | . 9 | 10 | 11 | a datafaqs:CKANDataset; 12 | . 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/lodcloud/tagged-with-topic-materials/sample-inputs/pass-and-fail.ttl.viajava: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/metadata/logd-catalog-listing.ttl: -------------------------------------------------------------------------------- 1 | @base . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix owl: . 5 | @prefix wgs: . 6 | @prefix dcterms: . 7 | @prefix doap: . 8 | @prefix foaf: . 9 | @prefix skos: . 10 | @prefix sioc: . 11 | @prefix void: . 12 | @prefix ov: . 13 | @prefix qb: . 14 | @prefix conversion: . 15 | @prefix datafaqs: . 16 | @prefix dbpedia: . 17 | @prefix prov: . 18 | @prefix twi: . 19 | 20 | 21 | a datafaqs:FAqTService . 22 | 23 | 24 | foaf:homepage . 25 | 26 | <> 27 | prov:specializationOf . 28 | 29 | [] 30 | a prov:Activity ; 31 | prov:hadQualifiedAttribution [ 32 | a prov:Attribution ; 33 | prov:adoptedPlan ; 34 | prov:hadQualifiedEntity 35 | ] . 36 | 37 | -------------------------------------------------------------------------------- /services/sadi/faqt/naming/uris-do-not-start-with-file-protocol.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/services/sadi/faqt/naming/uris-do-not-start-with-file-protocol.txt -------------------------------------------------------------------------------- /services/sadi/faqt/predicate-counter-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/provenance/named-graph-derivation-materials/sample-inputs/golfers.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix dcat: . 4 | @prefix void: . 5 | @prefix sd: . 6 | @prefix datafaqs: . 7 | @prefix : . 8 | 9 | :service 10 | a sd:Service; 11 | sd:endpoint ; 12 | sd:availableGraphs :collection; 13 | . 14 | 15 | :collection 16 | a sd:GraphCollection, dcat:Dataset; 17 | sd:namedGraph :named-graph; 18 | . 19 | 20 | :named-graph 21 | a sd:NamedGraph; 22 | sd:name ; 23 | rdfs:comment "We want to know where the triples in here came from."; 24 | sd:graph :graph; 25 | rdfs:comment "We can associate void:dataDump files to :graph to show other places that the graph is located."; 26 | . 27 | 28 | :graph a void:Dataset . 29 | 30 | #3> <> prov:specializationOf ; 31 | #3> prov:wasAttributedTo ; 32 | #3> rdfs:seeAlso . 33 | -------------------------------------------------------------------------------- /services/sadi/faqt/readme.md: -------------------------------------------------------------------------------- 1 | * Directories organize FAqT evaluation services by characteristic. 2 | * Directories ending in '-materials' contain 'sample-inputs' and other materials for the corresponding FAqT service implementation. 3 | * Files ending in '.ttl' provide metadata about the '.rpy' (the metadata was extracted directly from the '.rpy') 4 | 5 | access/ - 6 | discuss/ 7 | lodcloud/ 8 | naming/ 9 | typing/ 10 | vocabulary/ 11 | sparql-service-description/ 12 | 13 | completeness-materials/ 14 | completeness.rpy 15 | completeness.ttl 16 | 17 | consistensy-materials/ 18 | consistensy.py 19 | 20 | internet-domain.rpy 21 | 22 | predicate-counter-materials/ 23 | predicate-counter.rpy 24 | 25 | redirect-loop-materials/ 26 | redirect-loop.rpy 27 | 28 | resolvability-materials/ 29 | resolvability.py 30 | 31 | triple-count-accuracy.rpy 32 | 33 | vocabulary-count-materials/ 34 | vocabulary-count.py 35 | 36 | void-properties-materials/ 37 | void-properties.rpy 38 | 39 | void-triples-materials/ 40 | void-triples.rpy 41 | -------------------------------------------------------------------------------- /services/sadi/faqt/redirect-loop-materials/sample-inputs/does-not-have-redirect-loop.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix void: . 6 | @prefix moat: . 7 | @prefix datafaqs: . 8 | 9 | 10 | a void:Dataset ; 11 | . 12 | -------------------------------------------------------------------------------- /services/sadi/faqt/redirect-loop-materials/sample-inputs/has-redirect-loop.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix void: . 6 | @prefix moat: . 7 | @prefix datafaqs: . 8 | 9 | 10 | a void:Dataset ; 11 | . 12 | -------------------------------------------------------------------------------- /services/sadi/faqt/resolvability-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/sparql-service-description/named-graphs-materials/sample-inputs/logd.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix sd: . 3 | 4 | 5 | a sd:Service; 6 | rdfs:comment "Externally-facing production endpoint"; 7 | . 8 | 9 | 10 | a sd:Service; 11 | rdfs:comment "Internal production endpoint"; 12 | . 13 | -------------------------------------------------------------------------------- /services/sadi/faqt/sparql-service-description/named-graphs-materials/sample-inputs/mondeca.rq: -------------------------------------------------------------------------------- 1 | prefix ends: 2 | prefix void: 3 | prefix sd: 4 | 5 | construct { ?endpoint a sd:Service } 6 | where { 7 | [] void:sparqlEndpoint ?endpointL; 8 | ends:status [ ends:statusIsAvailable true ] 9 | bind(IRI(?endpointL) as ?endpoint) 10 | } 11 | -------------------------------------------------------------------------------- /services/sadi/faqt/sparql-service-description/named-graphs-materials/sample-inputs/mondeca.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf mondeca/mondeca.rq.* 4 | cache-queries.sh http://labs.mondeca.com/endpoint/ends -p format -o RDFXML -q mondeca.rq -od mondeca 5 | -------------------------------------------------------------------------------- /services/sadi/faqt/sparql-service-description/named-graphs-materials/sample-inputs/mondeca.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdfs: . 2 | @prefix sd: . 3 | 4 | 5 | a sd:Service; 6 | rdfs:comment "Example where the sd:Service is valid and has named graphs."; 7 | . 8 | 9 | 10 | a sd:Service; 11 | . 12 | 13 | 14 | rdfs:comment "listed at http://labs.mondeca.com/sparqlEndpointsStatus/"; 15 | rdfs:comment "Example where the sd:Service is valid but has no named graphs"; 16 | . 17 | 18 | 19 | sd:url ; 20 | rdfs:comment "Example where the sd:Service does not respond but its sd:url does."; 21 | . 22 | -------------------------------------------------------------------------------- /services/sadi/faqt/triple-count-accuracy.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import sadi 7 | from rdflib import * 8 | import surf 9 | 10 | from surf import * 11 | from surf.query import select 12 | 13 | import rdflib 14 | rdflib.plugin.register('sparql', rdflib.query.Processor, 15 | 'rdfextras.sparql.processor', 'Processor') 16 | rdflib.plugin.register('sparql', rdflib.query.Result, 17 | 'rdfextras.sparql.query', 'SPARQLQueryResult') 18 | 19 | import httplib 20 | from urlparse import urlparse, urlunparse 21 | import urllib 22 | import urllib2 23 | 24 | # These are the namespaces we are using beyond those already available 25 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 26 | ns.register(moat='http://moat-project.org/ns#') 27 | ns.register(ov='http://open.vocab.org/terms/') 28 | ns.register(void='http://rdfs.org/ns/void#') 29 | ns.register(conversion='http://purl.org/twc/vocab/conversion/') 30 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 31 | 32 | def getHEAD(url): 33 | # Ripped from https://github.com/timrdf/csv2rdf4lod-automation/blob/master/bin/util/pcurl.py 34 | o = urlparse(str(url)) 35 | print o 36 | connections = {'http' :httplib.HTTPConnection, 37 | 'https':httplib.HTTPSConnection} 38 | connection = connections[o.scheme](o.netloc) 39 | fullPath = urlunparse([None,None,o.path,o.params,o.query,o.fragment]) 40 | connection.request('HEAD',fullPath) 41 | return connection.getresponse() 42 | 43 | # The Service itself 44 | class TripleCountAccuracy(faqt.Service): 45 | 46 | # Service metadata. 47 | label = 'triple-count-accuracy' 48 | serviceDescriptionText = 'Measures accuracy of void:triples assertion compared to the triple count of the RDF found at void:dataDump.' 49 | comment = '' 50 | serviceNameText = 'triple-count-accuracy' # Convention: Match 'name' below. 51 | name = 'triple-count-accuracy' # This value determines the service URI relative to http://localhost:9090/ 52 | # Convention: Use the name of this file for this value. 53 | def __init__(self): 54 | faqt.Service.__init__(self, servicePath = 'services/sadi/faqt') 55 | 56 | def getOrganization(self): 57 | result = self.Organization() 58 | result.mygrid_authoritative = True 59 | result.protegedc_creator = 'lebot@rpi.edu' 60 | result.save() 61 | return result 62 | 63 | def getInputClass(self): 64 | return ns.DATAFAQS['DatasetWithDump'] 65 | 66 | def getOutputClass(self): 67 | return ns.DATAFAQS['EvaluatedDataset'] 68 | 69 | def process(self, input, output): 70 | output.save() 71 | 72 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 73 | resource = TripleCountAccuracy() 74 | 75 | # Used when this service is manually invoked from the command line (for testing). 76 | if __name__ == '__main__': 77 | sadi.publishTwistedService(resource, port=9094) 78 | -------------------------------------------------------------------------------- /services/sadi/faqt/typing/instance-types-are-known-by-domain-and-range.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 2 | {\fonttbl} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | } -------------------------------------------------------------------------------- /services/sadi/faqt/typing/instances-are-explicitly-typed.py: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso . 3 | 4 | import faqt 5 | 6 | import sadi 7 | from rdflib import * 8 | import surf 9 | 10 | from surf import * 11 | from surf.query import select 12 | 13 | import rdflib 14 | rdflib.plugin.register('sparql', rdflib.query.Processor, 15 | 'rdfextras.sparql.processor', 'Processor') 16 | rdflib.plugin.register('sparql', rdflib.query.Result, 17 | 'rdfextras.sparql.query', 'SPARQLQueryResult') 18 | 19 | import httplib 20 | from urlparse import urlparse, urlunparse 21 | import urllib 22 | import urllib2 23 | 24 | # These are the namespaces we are using beyond those already available 25 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 26 | ns.register(moat='http://moat-project.org/ns#') 27 | ns.register(ov='http://open.vocab.org/terms/') 28 | ns.register(void='http://rdfs.org/ns/void#') 29 | ns.register(conversion='http://purl.org/twc/vocab/conversion/') 30 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 31 | 32 | def getHEAD(url): 33 | # Ripped from https://github.com/timrdf/csv2rdf4lod-automation/blob/master/bin/util/pcurl.py 34 | o = urlparse(str(url)) 35 | print o 36 | connections = {'http' :httplib.HTTPConnection, 37 | 'https':httplib.HTTPSConnection} 38 | connection = connections[o.scheme](o.netloc) 39 | fullPath = urlunparse([None,None,o.path,o.params,o.query,o.fragment]) 40 | connection.request('HEAD',fullPath) 41 | return connection.getresponse() 42 | 43 | # The Service itself 44 | class InstancesAreExplicitlyTyped(faqt.Service): 45 | 46 | # Service metadata. 47 | label = 'instances-are-explicitly-typed' 48 | serviceDescriptionText = 'Percentage of instances that are explicitly typed.' 49 | comment = '' 50 | serviceNameText = 'instances-are-explicitly-typed' # Convention: Match 'name' below. 51 | name = 'instances-are-explicitly-typed' # This value determines the service URI relative to http://localhost:9090/ 52 | # Convention: Use the name of this file for this value. 53 | def __init__(self): 54 | faqt.Service.__init__(self, servicePath = 'services/sadi/faqt/typing') 55 | 56 | def getOrganization(self): 57 | result = self.Organization('http://tw.rpi.edu') 58 | result.mygrid_authoritative = True 59 | result.protegedc_creator = 'lebot@rpi.edu' 60 | result.save() 61 | return result 62 | 63 | def getInputClass(self): 64 | return ns.DATAFAQS['DatasetWithDump'] 65 | 66 | def getOutputClass(self): 67 | return ns.DATAFAQS['EvaluatedDataset'] 68 | 69 | def process(self, input, output): 70 | output.save() 71 | 72 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 73 | resource = InstancesAreExplicitlyTyped() 74 | 75 | # Used when this service is manually invoked from the command line (for testing). 76 | if __name__ == '__main__': 77 | sadi.publishTwistedService(resource, port=9094) 78 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary-count-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary/instances-in-same-namespace-as-ontology-bad.txt: -------------------------------------------------------------------------------- 1 | I just wanted to point out that isn't a generally accepted practice to have your instances and ontology in the namespace: 2 | 3 | 4 | a 5 | 6 | I'd suggest you rename to another namespace that is dedicated to your ontology. 7 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary/uses/prov-materials/sample-inputs/dbpedia.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | @prefix datafaqs: . 3 | 4 | a dcat:Dataset, datafaqs:CKANDataset . 5 | 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary/uses/prov-materials/sample-inputs/nothing.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcat: . 2 | 3 | a dcat:Dataset . 4 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary/vocabulary-resolves-to-description-materials/sample-inputs/myclass.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix owl: . 4 | @prefix xsd: . 5 | @prefix : . 6 | 7 | :myclass 8 | a :MyClass; 9 | rdfs:comment "An instance so that the vocabulary will be checked."; 10 | rdfs:comment """The 'text/plain' from github should be 'text/turtle': 11 | bash-3.2$ curl -LI http://purl.org/twc/vocab/resolves-to-incorrect-content-type 12 | HTTP/1.1 302 Moved Temporarily 13 | Location: https://raw.github.com/timrdf/DataFAQs/master/ontology/resolves-to-incorrect-content-type.ttl 14 | Content-Type: text/html; charset=iso-8859-1 15 | Content-Length: 326 16 | 17 | HTTP/1.1 200 OK 18 | Content-Type: text/plain; charset=utf-8"""; 19 | . 20 | -------------------------------------------------------------------------------- /services/sadi/faqt/vocabulary/vocabulary-resolves-to-description.py: -------------------------------------------------------------------------------- 1 | # <> prov:specializationOf . 2 | 3 | import faqt 4 | 5 | from urlparse import urlparse 6 | from surf import * 7 | import sadi 8 | 9 | # These are the namespaces we are using beyond those already available 10 | # (see http://packages.python.org/SuRF/modules/namespace.html#registered-general-purpose-namespaces) 11 | ns.register(void='http://rdfs.org/ns/void#') 12 | ns.register(datafaqs='http://purl.org/twc/vocab/datafaqs#') 13 | #ns.register(datafaqs='http://sparql.tw.rpi.edu/test/datafaqs.owl#') 14 | 15 | # The Service itself 16 | class VocabularyResolvesToDescription(faqt.Service): 17 | 18 | # Service metadata. 19 | label = 'vocabulary-resolves-to-description' 20 | serviceDescriptionText = 'Number of predicate and class URIs that resolve to an RDF description that types them.' 21 | comment = 'http://semantic.ckan.net/record/91d2c0de-75a4-4bb6-b260-bc2946e1be8b.rdf files with moat:taggedWithTag' 22 | serviceNameText = 'vocabulary-resolves-to-description' # Convention: Match 'name' below. 23 | name = 'vocabulary-resolves-to-description' # This value determines the service URI relative to http://localhost:9090/ 24 | # Convention: Use the name of this file for this value. 25 | def __init__(self): 26 | faqt.Service.__init__(self, servicePath = 'services/sadi/faqt/vocabulary') 27 | 28 | def getOrganization(self): 29 | result = self.Organization('http://tw.rpi.edu') 30 | result.mygrid_authoritative = True 31 | result.protegedc_creator = 'lebot@rpi.edu' 32 | result.save() 33 | return result 34 | 35 | def getInputClass(self): 36 | return ns.VOID['Dataset'] 37 | 38 | def getOutputClass(self): 39 | return ns.DATAFAQS['EvaluatedDataset'] 40 | 41 | def process(self, input, output): 42 | output.save() 43 | 44 | # Used when Twistd invokes this service b/c it is sitting in a deployed directory. 45 | resource = VocabularyResolvesToDescription() 46 | 47 | # Used when this service is manually invoked from the command line (for testing). 48 | if __name__ == '__main__': 49 | sadi.publishTwistedService(resource, port=9100) 50 | -------------------------------------------------------------------------------- /services/sadi/faqt/void-properties-materials/sample-input/congresspeople-datadump.ttl: -------------------------------------------------------------------------------- 1 | @prefix void: . 2 | 3 | 4 | a void:Dataset; 5 | void:dataDump . 6 | -------------------------------------------------------------------------------- /services/sadi/faqt/void-triples-materials/sample-inputs/has-triples-asserted-when-dereferenced.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /services/sadi/faqt/void-triples-materials/sample-inputs/has-triples-asserted.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix sioc: . 4 | @prefix ov: . 5 | @prefix void: . 6 | @prefix moat: . 7 | @prefix datafaqs: . 8 | 9 | 10 | a void:Dataset ; 11 | . 12 | -------------------------------------------------------------------------------- /services/sadi/prov/rdf2asn-materials/sample-inputs/multiple-types.ttl: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix rdfs: . 3 | @prefix owl: . 4 | @prefix dcterms: . 5 | @prefix sd: . 6 | @prefix void: . 7 | @prefix foaf: . 8 | @prefix prov: . 9 | @prefix : . 10 | 11 | :entity 12 | a prov:Entity; 13 | prov:identifier "entity"; 14 | . 15 | 16 | :activity 17 | a prov:Activity; 18 | prov:identifier "activity"; 19 | . 20 | 21 | :agent 22 | a prov:Agent; 23 | . 24 | -------------------------------------------------------------------------------- /services/sadi/readme.md: -------------------------------------------------------------------------------- 1 | [ckan/](https://github.com/timrdf/DataFAQs/tree/master/services/sadi/ckan) contains SADI services that help get dataset listings into CKAN. 2 | 3 | [contextual-inverse-function/](https://github.com/timrdf/DataFAQs/tree/master/services/sadi/contextual-inverse-functional) was the first hello world with SADI. 4 | 5 | [core/](https://github.com/timrdf/DataFAQs/tree/master/services/sadi/core) contains the services invoked by an Epoch configuration to determine which datasets and FAqT evaluation services should be used. 6 | 7 | [faqt/](https://github.com/timrdf/DataFAQs/tree/master/services/sadi/faqt) contains the FAqT evaluation services. 8 | 9 | [faqt-template.rpy](https://github.com/timrdf/DataFAQs/blob/master/services/sadi/faqt-template.rpy) should be copied when creating a new FAqT evaluation service. See https://github.com/timrdf/DataFAQs/wiki/FAqT-Service. 10 | -------------------------------------------------------------------------------- /services/sadi/sadi-services.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/services/sadi/sadi-services.war -------------------------------------------------------------------------------- /services/sadi/util/wikitable-fol-materials/sample-inputs/provdm-wd3.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | a foaf:Document . 4 | -------------------------------------------------------------------------------- /services/sadi/util/wikitable-fol-materials/sample-inputs/provdm-wd4.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | a foaf:Document . 4 | -------------------------------------------------------------------------------- /services/sadi/util/wikitable-fol-materials/sample-inputs/provdm.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | a foaf:Document . 4 | -------------------------------------------------------------------------------- /services/sadi/util/wikitable-gspo-materials/sample-inputs/prov-xg-mappings.ttl: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | @prefix foaf: . 3 | @prefix owl: . 4 | @prefix void: . 5 | @prefix prov: . 6 | @prefix dcat: . 7 | @prefix conversion: . 8 | @prefix datafaqs: . 9 | 10 | 11 | a foaf:Document; 12 | dcterms:hasPart ; 13 | . 14 | 15 | 16 | a dcat:Dataset; 17 | prov:wasAttributedTo ; 18 | prov:specializationOf ; 19 | . 20 | 21 | 22 | a dcat:Dataset, datafaqs:CKANDataset; 23 | . 24 | 25 | 26 | a prov:Organization; 27 | foaf:member , 28 | , 29 | ; 30 | . 31 | 32 | 33 | a dcat:Dataset; 34 | dcat:accessURL ; 35 | prov:alternateOf ; 36 | prov:wasDerivedFrom ; 37 | prov:wasAttributedTo ; 38 | . 39 | 40 | 41 | a void:Dataset, conversion:AbstractDataset; 42 | prov:wasDerivedFrom ; 43 | prov:specializationOf ; 44 | . 45 | 46 | 47 | a prov:Organization; 48 | foaf:member , 49 | , 50 | , 51 | ; 52 | . 53 | 54 | 55 | owl:sameAs ; 56 | . 57 | -------------------------------------------------------------------------------- /services/sadi/util/wikitable-gspo-materials/sample-inputs/provrdf.ttl: -------------------------------------------------------------------------------- 1 | @prefix foaf: . 2 | 3 | a foaf:Document . 4 | a foaf:Document . 5 | a foaf:Document . 6 | a foaf:Document . 7 | a foaf:Document . 8 | -------------------------------------------------------------------------------- /services/sadi/util/wikitable-gspo-materials/sample-inputs/provrdf.ttl.out: -------------------------------------------------------------------------------- 1 | @prefix dcterms: . 2 | 3 | a . 4 | 5 | a . 6 | 7 | a ; 8 | dcterms:subject . 9 | 10 | -------------------------------------------------------------------------------- /services/test/git2prov/sample-inputs/opendap.ttl: -------------------------------------------------------------------------------- 1 | @prefix doap: . 2 | 3 | a doap:GitRepository . 4 | a doap:GitRepository . 5 | -------------------------------------------------------------------------------- /services/test/git2prov/sample-inputs/opendap.ttl.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /services/test/git2prov/sample-inputs/run: -------------------------------------------------------------------------------- 1 | echo opendap.ttl.rdf.out 2 | curl -sH "Content-Type: application/rdf+xml" -d @opendap.ttl.rdf http://localhost:8080/sadi-services/git2prov > opendap.ttl.rdf.out 3 | echo opendap.ttl.rdf.out.ttl 4 | rapper -i rdfxml -o turtle opendap.ttl.rdf.out > opendap.ttl.rdf.out.ttl 5 | -------------------------------------------------------------------------------- /services/test/wikipedia-2-dbpedia-materials/on-datafaqstest.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | false 27 | lebot@rpi.edu 29 | 30 | 31 | wikipedia-2-dbpedia 33 | wikipedia-2-dbpedia 35 | 36 | 37 | -------------------------------------------------------------------------------- /services/test/wikipedia-2-dbpedia-materials/on-datafaqstest.url: -------------------------------------------------------------------------------- 1 | http://datafaqstest.tw.rpi.edu/sadi-services/wikipedia-2-dbpedia 2 | -------------------------------------------------------------------------------- /services/test/wikipedia-2-dbpedia-materials/sample-inputs/us-domain.ttl: -------------------------------------------------------------------------------- 1 | @prefix gn: . 2 | a gn:WikipediaArticle . 3 | -------------------------------------------------------------------------------- /services/test/wikipedia-2-dbpedia-materials/sample-inputs/us-domain.ttl.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /services/test/wikipedia-2-dbpedia-materials/sample-inputs/us-domain.ttl.rdf.out: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/java/sadi-services/.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | .classpath 3 | .project 4 | -------------------------------------------------------------------------------- /src/java/sadi-services/create-new-sadi-java-file: -------------------------------------------------------------------------------- 1 | #3> <> prov:specializationOf ; 2 | #3> rdfs:seeAlso ; 3 | #3> . 4 | 5 | mvn ca.wilkinsonlab.sadi:sadi-generator:generate-service -DserviceClass=edu.rpi.tw.data.quality.sadi.faqt.core.select.datasets.ByCKANTag -DinputClass=http://www.w3.org/ns/prov#Entity -DoutputClass=http://www.w3.org/ns/prov#Entity -DcontactEmail=lebot@rpi.edu -DserviceName=select-datasets-by-ckan-tag -DserviceDescription="Links a CKAN tag to the datasets that are in the tag." 6 | -------------------------------------------------------------------------------- /src/java/sadi-services/doc/eclipse/generate war.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/java/sadi-services/readme.md: -------------------------------------------------------------------------------- 1 | [sadi-services](https://github.com/timrdf/DataFAQs/tree/master/src/java/sadi-services) is a Java implementation for [FAqT Services](https://github.com/timrdf/DataFAQs/wiki/FAqT-Service), [SADI](https://github.com/timrdf/DataFAQs/wiki/SADI-Semantic-Web-Services-framework)-based dataset evaluation services. 2 | 3 | The dependency in pom.xml: 4 | 5 | ``` 6 | 7 | edu.rpi.tw 8 | ckanclient-j 9 | 1.7-SNAPSHOT 10 | 11 | ``` 12 | 13 | comes from developer-local ~/.m2 repository, and was placed there using 14 | https://github.com/timrdf/CKANClient-J/blob/master/pom.sh: 15 | 16 | * git clone git://github.com/timrdf/CKANClient-J.git, 17 | * run `ant dist`, and 18 | * source `pom.sh`. 19 | -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/naming/NameFactory.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.naming; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.math.BigInteger; 5 | import java.security.MessageDigest; 6 | import java.security.NoSuchAlgorithmException; 7 | 8 | /** 9 | * Some methods copied from csv2rdf4lod's NameFactory. 10 | */ 11 | public class NameFactory { 12 | 13 | public static String INSTANCE_HUB = "http://instances.tw.rpi.edu/id/"; 14 | 15 | /** 16 | * 17 | * @param value 18 | * @return the a hash (e.g. MD5) of the given 'value' 19 | */ 20 | public static String getMD5(String value) { 21 | byte[] bytesOfMessage; 22 | String hashtext = null; 23 | try { 24 | // http://stackoverflow.com/questions/415953/generate-md5-hash-in-java 25 | bytesOfMessage = (value).getBytes("UTF-8"); 26 | MessageDigest md = MessageDigest.getInstance("MD5"); 27 | byte[] digest = md.digest(bytesOfMessage); 28 | BigInteger bigInt = new BigInteger(1,digest); 29 | hashtext = bigInt.toString(16); 30 | } catch (UnsupportedEncodingException e) { 31 | e.printStackTrace(); 32 | } catch (NoSuchAlgorithmException e) { 33 | e.printStackTrace(); 34 | } 35 | return hashtext; 36 | } 37 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/provenance/Git2PROV.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.provenance; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLEncoder; 5 | 6 | import org.apache.log4j.Logger; 7 | 8 | import ca.wilkinsonlab.sadi.service.annotations.ContactEmail; 9 | import ca.wilkinsonlab.sadi.service.annotations.Description; 10 | import ca.wilkinsonlab.sadi.service.annotations.InputClass; 11 | import ca.wilkinsonlab.sadi.service.annotations.Name; 12 | import ca.wilkinsonlab.sadi.service.annotations.OutputClass; 13 | import ca.wilkinsonlab.sadi.service.simple.SimpleSynchronousServiceServlet; 14 | 15 | import com.hp.hpl.jena.rdf.model.Resource; 16 | import com.hp.hpl.jena.vocabulary.RDFS; 17 | 18 | import edu.rpi.tw.data.http.HTTPUtils; 19 | 20 | @Name("git2prov") 21 | @Description("Produces a PROV-O description of a given Git repository.") 22 | @ContactEmail("lebot@rpi.edu") 23 | @InputClass("http://usefulinc.com/ns/doap#GitRepository") 24 | @OutputClass("http://www.w3.org/ns/prov#Entity") 25 | public class Git2PROV extends SimpleSynchronousServiceServlet { 26 | 27 | private static final Logger log = Logger.getLogger(Git2PROV.class); 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public void processInput(Resource input, Resource output) { 32 | 33 | String inputS = input.asResource().getURI().toString(); 34 | log.warn("processing "+inputS); 35 | 36 | if( inputS.startsWith("http") ) { 37 | // git@github.com:tetherless-world/opendap.git needs to be rewritten as: 38 | // https://github.com/tetherless-world/opendap.git 39 | 40 | // https://github.com/tetherless-world/opendap.git 41 | // http://git2prov.org/git2prov?giturl=https%3A%2F%2Fgithub.com%2Ftetherless-world%2Fopendap.git&serialization=PROV-O 42 | try { 43 | String url = "http://git2prov.org/git2prov?giturl="+URLEncoder.encode(inputS, "UTF-8")+"&serialization=PROV-O"; 44 | log.warn("will request from: " + url); 45 | 46 | //String response = HTTPUtils.get(url, "text/turtle"); 47 | //log.warn("response: " + response); 48 | 49 | output.getModel().read(url,"TURTLE"); 50 | log.warn("loaded size: " + output.getModel().size()); 51 | 52 | } catch (UnsupportedEncodingException e) { 53 | e.printStackTrace(); 54 | } 55 | }else { 56 | output.addLiteral(RDFS.comment, "Git Repository needs to be HTTPS"); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/quality/sadi/faqt/FAqT.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.quality.sadi.faqt; 2 | 3 | import com.hp.hpl.jena.rdf.model.Resource; 4 | import com.hp.hpl.jena.vocabulary.RDF; 5 | 6 | import edu.rpi.tw.data.rdf.jena.vocabulary.DataFAQs; 7 | 8 | /** 9 | * 10 | */ 11 | public class FAqT { 12 | 13 | /** 14 | * 15 | * @param dataset 16 | */ 17 | public static void unsatisfactoryIfNotSatisfactory(Resource dataset) { 18 | if( !dataset.getModel().contains(dataset, RDF.type, DataFAQs.Satisfactory) ) { 19 | dataset.addProperty(RDF.type, DataFAQs.Unsatisfactory); 20 | } 21 | } 22 | 23 | /** 24 | * 25 | * @param dataset 26 | */ 27 | public static void satisfactoryIfNotUnsatisfactory(Resource dataset) { 28 | if( !dataset.getModel().contains(dataset, RDF.type, DataFAQs.Satisfactory) ) { 29 | dataset.addProperty(RDF.type, DataFAQs.Satisfactory); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/quality/sadi/faqt/core/select/datasets/ByCKANGroup.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.quality.sadi.faqt.core.select.datasets; 2 | 3 | import org.apache.log4j.Logger; 4 | import org.ckan.CKANException; 5 | import org.ckan.Client; 6 | import org.ckan.Connection; 7 | import org.ckan.Dataset; 8 | import org.ckan.Group; 9 | 10 | import ca.wilkinsonlab.sadi.service.annotations.ContactEmail; 11 | import ca.wilkinsonlab.sadi.service.annotations.Description; 12 | import ca.wilkinsonlab.sadi.service.annotations.InputClass; 13 | import ca.wilkinsonlab.sadi.service.annotations.Name; 14 | import ca.wilkinsonlab.sadi.service.annotations.OutputClass; 15 | import ca.wilkinsonlab.sadi.service.simple.SimpleSynchronousServiceServlet; 16 | 17 | import com.hp.hpl.jena.rdf.model.Model; 18 | import com.hp.hpl.jena.rdf.model.Resource; 19 | import com.hp.hpl.jena.vocabulary.DCTerms; 20 | import com.hp.hpl.jena.vocabulary.RDF; 21 | 22 | import edu.rpi.tw.data.ckan.CKANReader; 23 | import edu.rpi.tw.data.rdf.jena.vocabulary.DCAT; 24 | import edu.rpi.tw.data.rdf.jena.vocabulary.DataFAQs; 25 | import edu.rpi.tw.data.rdf.jena.vocabulary.Prefixes; 26 | //import com.hp.hpl.jena.rdf.model.Statement; 27 | //import com.hp.hpl.jena.rdf.model.StmtIterator; 28 | 29 | /** 30 | * Java implementation of https://github.com/timrdf/DataFAQs/blob/master/services/sadi/core/select-datasets/by-ckan-group.py 31 | * 32 | */ 33 | @Name("select-datasets-by-ckan-group") 34 | @Description("Links a CKAN group to the datasets that are in the group.") 35 | @ContactEmail("lebot@rpi.edu") 36 | @InputClass("http://purl.org/twc/vocab/datafaqs#CKANGroup") 37 | @OutputClass("http://purl.org/twc/vocab/datafaqs#DatasetCollection") 38 | public class ByCKANGroup extends SimpleSynchronousServiceServlet { 39 | 40 | private static final Logger log = Logger.getLogger(ByCKANGroup.class); 41 | private static final long serialVersionUID = 1L; 42 | 43 | @Override 44 | public void processInput(Resource input, Resource output) { 45 | 46 | String inputS = input.asResource().getURI().toString(); 47 | log.warn("processing "+inputS); 48 | String groupID = CKANReader.getCKANIdentifier(input); 49 | log.warn("processing id "+groupID); 50 | Model m = output.getModel(); 51 | Prefixes.setNsPrefixes(m); 52 | 53 | String base = CKANReader.getBaseURI(input); 54 | // (Taken from LiftCKAN) 55 | Client client = new Client( new Connection( CKANReader.getCKANAPI(input) ), ""); 56 | // ^ e.g. "http://datahub.io" 57 | 58 | try { 59 | Resource groupR = m.createResource(inputS, DataFAQs.CKANGroup); 60 | groupR.addProperty(RDF.type, DataFAQs.DatasetCollection); 61 | Group group = client.getGroup(groupID); 62 | for( Dataset dataset : group.getPackages() ) { 63 | //log.warn(groupID + " has dataset "+dataset.getName()); 64 | Resource datasetR = m.createResource(base+"/dataset/"+dataset.getName(), DataFAQs.CKANDataset); 65 | datasetR.addProperty(RDF.type, DCAT.Dataset); 66 | output.addProperty(DCTerms.hasPart, datasetR); 67 | } 68 | }catch (CKANException e) { 69 | e.printStackTrace(); 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/quality/sadi/faqt/core/select/datasets/ByCKANTag.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.quality.sadi.faqt.core.select.datasets; 2 | 3 | import org.apache.log4j.Logger; 4 | import org.ckan.CKANException; 5 | import org.ckan.Client; 6 | import org.ckan.Connection; 7 | import org.ckan.Dataset; 8 | 9 | import ca.wilkinsonlab.sadi.service.annotations.ContactEmail; 10 | import ca.wilkinsonlab.sadi.service.annotations.Description; 11 | import ca.wilkinsonlab.sadi.service.annotations.InputClass; 12 | import ca.wilkinsonlab.sadi.service.annotations.Name; 13 | import ca.wilkinsonlab.sadi.service.annotations.OutputClass; 14 | import ca.wilkinsonlab.sadi.service.simple.SimpleSynchronousServiceServlet; 15 | 16 | import com.hp.hpl.jena.rdf.model.Model; 17 | import com.hp.hpl.jena.rdf.model.Resource; 18 | import com.hp.hpl.jena.vocabulary.DCTerms; 19 | import com.hp.hpl.jena.vocabulary.RDF; 20 | 21 | import edu.rpi.tw.data.ckan.CKANReader; 22 | import edu.rpi.tw.data.rdf.jena.vocabulary.DCAT; 23 | import edu.rpi.tw.data.rdf.jena.vocabulary.DataFAQs; 24 | import edu.rpi.tw.data.rdf.jena.vocabulary.Prefixes; 25 | 26 | /** 27 | * Java alternative to https://github.com/timrdf/DataFAQs/blob/master/services/sadi/core/select-datasets/by-ckan-tag.py 28 | * 29 | */ 30 | @Name("select-datasets-by-ckan-tag") 31 | @Description("Links a CKAN tag to the datasets that are in the tag.") 32 | @ContactEmail("lebot@rpi.edu") 33 | @InputClass("http://moat-project.org/ns#Tag") 34 | @OutputClass("http://purl.org/twc/vocab/datafaqs#DatasetCollection") 35 | public class ByCKANTag extends SimpleSynchronousServiceServlet { 36 | 37 | private static final Logger log = Logger.getLogger(ByCKANTag.class); 38 | private static final long serialVersionUID = 1L; 39 | 40 | @Override 41 | public void processInput(Resource input, Resource output) { 42 | 43 | String inputS = input.asResource().getURI().toString(); 44 | log.warn("processing "+inputS); 45 | String tagID = CKANReader.getCKANIdentifier(input); 46 | log.warn("processing id "+tagID); 47 | Model m = output.getModel(); 48 | Prefixes.setNsPrefixes(m); 49 | 50 | String base = CKANReader.getBaseURI(input); 51 | log.warn("ckan base URI "+base); 52 | log.warn("ckan API "+CKANReader.getCKANAPI(input)); 53 | // (Taken from LiftCKAN) 54 | Client client = new Client( new Connection( CKANReader.getCKANAPI(input) ), ""); 55 | // ^ e.g. "http://datahub.io" 56 | 57 | try { 58 | output.addProperty(RDF.type, DataFAQs.DatasetCollection); 59 | for( Dataset dataset : client.findDatasetsByTag(tagID) ) { 60 | //log.warn(groupID + " has dataset "+dataset.getName()); 61 | Resource datasetR = m.createResource(base+"/dataset/"+dataset.getName(), DataFAQs.CKANDataset); 62 | datasetR.addProperty(RDF.type, DCAT.Dataset); 63 | output.addProperty(DCTerms.hasPart, datasetR); 64 | } 65 | }catch (CKANException e) { 66 | e.printStackTrace(); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/ANY.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena; 2 | 3 | import com.hp.hpl.jena.rdf.model.Resource; 4 | import com.hp.hpl.jena.rdf.model.Property; 5 | import com.hp.hpl.jena.rdf.model.RDFNode; 6 | 7 | public class ANY { 8 | public static Resource s = (Resource) null; 9 | public static Property p = (Property) null; 10 | public static RDFNode o = (RDFNode) null; 11 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/CON.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | 7 | public class CON { 8 | private static Model m_model = ModelFactory.createDefaultModel(); 9 | 10 | public static String prefix = "con"; 11 | public static String ns = "http://www.w3.org/2000/10/swap/pim/contact#"; 12 | 13 | //public static final Resource Dataset = m_model.createResource(ns+"Dataset"); 14 | 15 | public static final Property preferredURI = m_model.createProperty(ns+"preferredURI"); 16 | } 17 | -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/DCAT.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class DCAT { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "dcat"; 13 | public static String ns = "http://www.w3.org/ns/dcat#"; 14 | 15 | public static final Resource Dataset = m_model.createResource(ns+"Dataset"); 16 | public static final Property distribution = m_model.createProperty(ns+"distribution"); 17 | 18 | public static final Resource Distribution = m_model.createResource(ns+"Distribution"); 19 | public static final Property accessURL = m_model.createProperty(ns+"accessURL"); 20 | public static final Property downloadURL = m_model.createProperty(ns+"downloadURL"); 21 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/DataFAQs.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class DataFAQs { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "datafaqs"; 13 | public static String ns = "http://purl.org/twc/vocab/datafaqs#"; 14 | 15 | public static final Resource Evaluated = m_model.createResource(ns+"Evaluated"); 16 | public static final Resource Satisfactory = m_model.createResource(ns+"Satisfactory"); 17 | public static final Resource Unsatisfactory = m_model.createResource(ns+"Unsatisfactory"); 18 | 19 | public static final Property ckan_identifier = m_model.createProperty(ns+"ckan_identifier"); 20 | public static final Property todo = m_model.createProperty(ns+"todo"); 21 | 22 | 23 | public static final Resource CKANDataset = m_model.createResource(ns+"CKANDataset"); 24 | public static final Resource CKANGroup = m_model.createResource(ns+"CKANGroup"); 25 | public static final Resource CKANResource = m_model.createResource(ns+"CKANResource"); 26 | public static final Resource DatasetCollection = m_model.createResource(ns+"DatasetCollection"); 27 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/FOAF.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | 7 | public class FOAF { 8 | private static Model m_model = ModelFactory.createDefaultModel(); 9 | 10 | public static String prefix = "foaf"; 11 | public static String ns = "http://xmlns.com/foaf/0.1/"; 12 | 13 | public static final Property knows = m_model.createProperty(ns+"knows"); 14 | } 15 | -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/Formats.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import java.util.HashMap; 4 | 5 | import com.hp.hpl.jena.rdf.model.Model; 6 | import com.hp.hpl.jena.rdf.model.ModelFactory; 7 | import com.hp.hpl.jena.rdf.model.Property; 8 | import com.hp.hpl.jena.rdf.model.Resource; 9 | 10 | /** 11 | * See http://www.w3.org/ns/formats/ 12 | * 13 | */ 14 | public class Formats { 15 | 16 | private static Model m_model = ModelFactory.createDefaultModel(); 17 | 18 | public static String prefix = "formats"; 19 | public static String ns = "http://www.w3.org/ns/formats/"; 20 | 21 | public static final Resource Format = m_model.createResource(ns+"Format"); 22 | 23 | public static final Property media_type = m_model.createProperty(ns+"media_type"); 24 | public static final Property preferred_suffix = m_model.createProperty(ns+"preferred_suffix"); 25 | 26 | // Format URIs 27 | public static final Resource N3 = m_model.createResource(ns + "N3"); 28 | public static final Resource NTriples = m_model.createResource(ns + "N-Triples"); 29 | public static final Resource RDFa = m_model.createResource(ns + "RDFa"); 30 | public static final Resource RDF_XML = m_model.createResource(ns + "RDF_XML"); 31 | public static final Resource Turtle = m_model.createResource(ns + "Turtle"); 32 | 33 | public static final Resource OWL_XML = m_model.createResource(ns + "OWL_XML"); 34 | public static final Resource OWL_Functional = m_model.createResource(ns + "OWL_Functional"); 35 | public static final Resource OWL_Manchester = m_model.createResource(ns + "OWL_Manchester"); 36 | 37 | public static final Resource SPARQL_Results_XML = m_model.createResource(ns + "SPARQL_Results_XML"); 38 | public static final Resource SPARQL_Results_JSON = m_model.createResource(ns + "SPARQL_Results_JSON"); 39 | public static final Resource SPARQL_Results_CSV = m_model.createResource(ns + "SPARQL_Results_CSV"); 40 | public static final Resource SPARQL_Results_TSV = m_model.createResource(ns + "SPARQL_Results_TSV"); 41 | 42 | public static final Resource POWDER = m_model.createResource(ns + "POWDER"); 43 | public static final Resource POWDER_S = m_model.createResource(ns + "POWDER-S"); 44 | 45 | public static final Resource RIF_XML = m_model.createResource(ns + "RIF_XML"); 46 | 47 | public static final Resource PROV_N = m_model.createResource(ns + "PROV-N"); 48 | public static final Resource PROV_XML = m_model.createResource(ns + "PROV-XML"); 49 | 50 | public static final Resource JSON_LD = m_model.createResource(ns + "JSON-LD"); 51 | 52 | // Mapping labels to Formats 53 | public static final HashMap formats = new HashMap(); 54 | static { 55 | formats.put("rdf+xml", RDF_XML); 56 | formats.put("turtle", Turtle); 57 | formats.put("ntriples", NTriples); 58 | formats.put("x-ntriples", NTriples); 59 | formats.put("x-quads", null); 60 | formats.put("rdfa", RDFa); 61 | formats.put("x-trig", null); 62 | } 63 | 64 | /** 65 | * 66 | * @param label 67 | * @return 68 | */ 69 | public static Resource getFormat(String label) { 70 | return formats.containsKey(label) ? formats.get(label) : null; 71 | } 72 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/GeoNames.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | /** 9 | * 10 | */ 11 | public class GeoNames { 12 | 13 | private static Model m_model = ModelFactory.createDefaultModel(); 14 | 15 | public static String prefix = "geonames"; 16 | public static String ns = "http://www.geonames.org/ontology#"; 17 | 18 | public static final Resource WikipediaArticle = m_model.createResource(ns+"WikipediaArticle"); 19 | 20 | public static final Property parentFeature = m_model.createProperty(ns+"parentFeature"); 21 | public static final Property nearby = m_model.createProperty(ns+"nearby"); 22 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/OV.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | 7 | public class OV { 8 | 9 | private static Model m_model = ModelFactory.createDefaultModel(); 10 | 11 | public static String prefix = "ov"; 12 | public static String ns = "http://open.vocab.org/terms/"; 13 | 14 | //public static final Resource Evaluated = m_model.createResource(ns+"Evaluated"); 15 | 16 | public static final Property shortName = m_model.createProperty(ns+"shortName"); 17 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/PROV.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class PROV { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "prov"; 13 | public static String ns = "http://www.w3.org/ns/prov#"; 14 | 15 | public static final Resource Entity = m_model.createResource(ns+"Entity"); 16 | 17 | public static final Property wasInfluencedBy = m_model.createProperty(ns+"wasInfluencedBy"); 18 | public static final Property wasDerivedFrom = m_model.createProperty(ns+"wasDerivedFrom"); 19 | 20 | public static final Property wasAttributedTo = m_model.createProperty(ns+"wasAttributedTo"); 21 | 22 | public static final Property atLocation = m_model.createProperty(ns+"atLocation"); 23 | public static final Property value = m_model.createProperty(ns+"value"); 24 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/Prefixes.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import java.util.HashMap; 4 | 5 | import com.hp.hpl.jena.rdf.model.Model; 6 | import com.hp.hpl.jena.vocabulary.DC; 7 | 8 | /** 9 | * 10 | */ 11 | public class Prefixes { 12 | 13 | private static HashMap prefixes = new HashMap(); 14 | static { 15 | prefixes.put(CON.prefix, CON.ns); 16 | prefixes.put(DataFAQs.prefix, DataFAQs.ns); 17 | prefixes.put(DCAT.prefix, DCAT.ns); 18 | prefixes.put("dcterms", DC.getURI()); 19 | prefixes.put(FOAF.prefix, FOAF.ns); 20 | prefixes.put(OV.prefix, OV.ns); 21 | prefixes.put(PROV.prefix, PROV.ns); 22 | prefixes.put(SD.prefix, SD.ns); 23 | prefixes.put(SIO.prefix, SIO.ns); 24 | prefixes.put(SIOC.prefix, SIOC.ns); 25 | prefixes.put(Tag.prefix, Tag.ns); 26 | prefixes.put(VoID.prefix, VoID.ns); 27 | } 28 | 29 | /** 30 | * 31 | * @param model 32 | */ 33 | public static void setNsPrefixes(Model model) { 34 | for( String prefix : prefixes.keySet() ) { 35 | model.setNsPrefix(prefix, prefixes.get(prefix)); 36 | } 37 | } 38 | 39 | /** 40 | * 41 | * @param prefixes 42 | * @return 43 | */ 44 | public static String declareTurtlePrefixes(String ... prefixes) { 45 | return declarePrefixes("@",".",prefixes); 46 | } 47 | 48 | /** 49 | * 50 | * @param prefixes 51 | * @return 52 | */ 53 | public static String declareSPARQLPrefixes(String ... prefixes) { 54 | return declarePrefixes("","",prefixes); 55 | } 56 | 57 | /** 58 | * 59 | * @param strings 60 | */ 61 | private static String declarePrefixes(String prepend, String append, String ... prefixes) { 62 | StringBuffer declaration = new StringBuffer(); 63 | for ( int i = 0; i < prefixes.length; ++i ) { 64 | String prefix = prefixes[i]; 65 | declaration.append(prepend + "prefix " + prefix + ": <" + Prefixes.prefixes.get(prefix) + "> "+append+"\n"); 66 | } 67 | return declaration.toString(); 68 | } 69 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/SD.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class SD { 9 | private static Model m_model = ModelFactory.createDefaultModel(); 10 | public static String prefix = "sd"; 11 | public static String ns = "http://www.w3.org/ns/sparql-service-description#"; 12 | 13 | public static final Resource Service = m_model.createResource(ns+"Service"); 14 | public static final Property endpoint = m_model.createProperty(ns+"endpoint"); 15 | public static final Property availableGraphs = m_model.createProperty(ns+"availableGraphs"); 16 | 17 | public static final Resource GraphCollection = m_model.createResource(ns+"GraphCollection"); 18 | public static final Property namedGraph = m_model.createProperty(ns+"namedGraph"); 19 | 20 | public static final Resource NamedGraph = m_model.createResource(ns+"NamedGraph"); 21 | public static final Property name = m_model.createProperty(ns+"name"); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/SIO.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | 7 | public class SIO { 8 | private static Model m_model = ModelFactory.createDefaultModel(); 9 | public static String prefix = "sio"; 10 | public static String ns = "http://semanticscience.org/resource/"; 11 | 12 | public static final Property count = m_model.createProperty(ns+"count"); 13 | } 14 | -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/SIOC.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class SIOC { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "sioc"; 13 | public static String ns = "http://rdfs.org/sioc/ns#"; 14 | 15 | public static final Resource Item = m_model.createResource(ns+"Item"); 16 | 17 | public static final Property ip_address = m_model.createProperty(ns+"ip_address"); 18 | 19 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/Tag.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class Tag { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "tag"; 13 | public static String ns = "http://www.holygoat.co.uk/owl/redwood/0.1/tags/"; 14 | 15 | public static final Resource Tag = m_model.createResource(ns+"Tag"); 16 | 17 | public static final Property taggedWithTag = m_model.createProperty(ns+"taggedWithTag"); 18 | public static final Property name = m_model.createProperty(ns+"name"); 19 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/VoID.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class VoID { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "void"; 13 | public static String ns = "http://rdfs.org/ns/void#"; 14 | 15 | public static final Resource Dataset = m_model.createResource(ns+"Dataset"); 16 | public static final Property subset = m_model.createProperty(ns+"subset"); 17 | public static final Property sparqlEndpoint = m_model.createProperty(ns+"sparqlEndpoint"); 18 | public static final Property triples = m_model.createProperty(ns+"triples"); 19 | public static final Property uriSpace = m_model.createProperty(ns+"uriSpace"); 20 | public static final Property vocabulary = m_model.createProperty(ns+"vocabulary"); 21 | public static final Property exampleResource = m_model.createProperty(ns+"exampleResource"); 22 | public static final Property dataDump = m_model.createProperty(ns+"dataDump"); 23 | 24 | public static final Resource Linkset = m_model.createResource(ns+"Linkset"); 25 | public static final Property target = m_model.createProperty(ns+"target"); 26 | } -------------------------------------------------------------------------------- /src/java/sadi-services/src/main/java/edu/rpi/tw/data/rdf/jena/vocabulary/WGS.java: -------------------------------------------------------------------------------- 1 | package edu.rpi.tw.data.rdf.jena.vocabulary; 2 | 3 | import com.hp.hpl.jena.rdf.model.Model; 4 | import com.hp.hpl.jena.rdf.model.ModelFactory; 5 | import com.hp.hpl.jena.rdf.model.Property; 6 | import com.hp.hpl.jena.rdf.model.Resource; 7 | 8 | public class WGS { 9 | 10 | private static Model m_model = ModelFactory.createDefaultModel(); 11 | 12 | public static String prefix = "wgs"; 13 | public static String ns = "http://www.w3.org/2003/01/geo/wgs84_pos#"; 14 | 15 | public static final Resource SpatialThing = m_model.createResource(ns+"SpatialThing"); 16 | 17 | 18 | public static final Property lat = m_model.createProperty(ns+"lat"); 19 | public static final Property lng = m_model.createProperty(ns+"long"); 20 | } -------------------------------------------------------------------------------- /src/python/faqt.python/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | ez_setup.pyc 3 | faqt.egg-info 4 | -------------------------------------------------------------------------------- /src/python/faqt.python/dist/faqt-0.0.1-py2.6.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/src/python/faqt.python/dist/faqt-0.0.1-py2.6.egg -------------------------------------------------------------------------------- /src/python/faqt.python/dist/faqt-0.0.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/src/python/faqt.python/dist/faqt-0.0.1-py2.7.egg -------------------------------------------------------------------------------- /src/python/faqt.python/dist/faqt-0.0.2-py2.6.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/src/python/faqt.python/dist/faqt-0.0.2-py2.6.egg -------------------------------------------------------------------------------- /src/python/faqt.python/dist/faqt-0.0.2-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timrdf/DataFAQs/fdabb40ff789337b918daa0bba5c89e9b37f91bd/src/python/faqt.python/dist/faqt-0.0.2-py2.7.egg -------------------------------------------------------------------------------- /src/python/faqt.python/example.py: -------------------------------------------------------------------------------- 1 | import faqt 2 | import sadi 3 | from rdflib import * 4 | from surf import * 5 | 6 | ns.register(hello="http://sadiframework.org/examples/hello.owl#") 7 | 8 | class ExampleService(sadi.Service): 9 | 10 | label = "by-ckan-tag" 11 | serviceDescriptionText = 'A simple "Hello, World" service that reads a name and attaches a greeting.' 12 | comment = 'A simple "Hello, World" service that reads a name and attaches a greeting.' 13 | serviceNameText = "by-ckan-tag" 14 | name = "by-ckan-tag" 15 | 16 | # These are used by faqt.py annotateServiceDescription 17 | rawBase = 'https://raw.github.com/timrdf/DataFAQs/master/services/sadi/core/select-datasets/' 18 | pageBase = 'https://github.com/timrdf/DataFAQs/blob/master/services/sadi/core/select-datasets/' 19 | 20 | def getOrganization(self): 21 | result = self.Organization("") 22 | result.mygrid_authoritative = False 23 | result.protegedc_creator = 'lebot@rpi.edu' 24 | result.save() 25 | return result 26 | 27 | def getInputClass(self): 28 | return ns.HELLO["NamedIndividual"] 29 | 30 | def getOutputClass(self): 31 | return ns.HELLO["GreetedIndividual"] 32 | 33 | def process(self, input, output): 34 | output.hello_greeting = "Hello, "+input.foaf_name[0] 35 | output.save() 36 | 37 | resource = ExampleService() 38 | 39 | if __name__ == "__main__": 40 | sadi.publishTwistedService(resource, port=9090) 41 | -------------------------------------------------------------------------------- /src/python/faqt.python/faqt/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'Tim Lebo' 2 | 3 | from faqt import * 4 | -------------------------------------------------------------------------------- /src/python/faqt.python/prov.ttl: -------------------------------------------------------------------------------- 1 | @prefix prov: . 2 | 3 | <../faqt.python> 4 | prov:wasDerivedFrom ; 5 | prov:wasAttributedTo ; 6 | . 7 | 8 | 9 | prov:wasAttributedTo ; 10 | . 11 | -------------------------------------------------------------------------------- /src/python/faqt.python/readme.md: -------------------------------------------------------------------------------- 1 | See https://github.com/timrdf/DataFAQs/wiki/faqt.python-package 2 | 3 | ## Build an egg 4 | 5 | Run: 6 | 7 | ``` 8 | python setup.py bdist_egg 9 | ``` 10 | 11 | to get dist/faqt-0.0.1-py2.7.egg 12 | 13 | (the '0.0.1' comes from setup.py's version attribute) 14 | 15 | ## Install to system 16 | 17 | sudo easy_install dist/faqt-0.0.1-py2.7.egg 18 | 19 | ## Register 20 | 21 | (Note: only needed to do this once) 22 | 23 | Ran the following from this directory to register at http://pypi.python.org/pypi/faqt 24 | 25 | ``` 26 | python setup.py register 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /src/python/faqt.python/setup.py: -------------------------------------------------------------------------------- 1 | from ez_setup import use_setuptools 2 | use_setuptools() 3 | 4 | from setuptools import setup, find_packages 5 | setup( 6 | name = "faqt", 7 | version = "0.0.2", 8 | packages = find_packages(exclude="example.py"), 9 | 10 | install_requires = ['rdflib>=3.0', 'surf', 'rdfextras', 'surf.rdflib'], 11 | 12 | # metadata for upload to PyPI 13 | author = "Tim Lebo", 14 | author_email = "lebot@rpi.edu", 15 | description = "Base for implementing DataFAQs FAqT Evaluation Services.", 16 | license = "Apache 2", 17 | keywords = "Webservices SemanticWeb, RDF, Python, REST", 18 | url = "https://github.com/timrdf/DataFAQs/wiki/faqt.python-package", # project home page, if any 19 | 20 | # could also include long_description, download_url, classifiers, etc. 21 | ) 22 | --------------------------------------------------------------------------------