Package: kglab
kglabWelcome toGraph Data Science:https://derwen.ai/docs/kgl/Thekglablibrary provides a simple abstraction layer in Python 3.7+
for building knowledge graphs, leveraging Pandas, NetworkX, RAPIDS, RDFLib,
Morph-KGC, pythonPSL, and many more.SPECIAL REQUEST:Which features would you like in an open source Python library for building knowledge graphs?Please add your suggestions through this survey:https://forms.gle/FMHgtmxHYWocprMn6This will help us prioritize thekglabroadmap.Reviews@kaaloo:"Feels like it's a Hugging Face for graphs! 🤯"Getting StartedSee the"Getting Started"section of the online documentation.We recommend installing fromPyPi:python3-mpipinstallkglabIf you work directly from this Git repo, be sure to install the
dependencies:python3-mpipinstall-Upipwheel
python3-mpipinstall-rrequirements.txtAlternatively, to install dependencies usingconda:condaenvcreate-fenvironment.yml--force
condaactivatekglabThen to run some simple uses of this library:importkglab# create a KnowledgeGraph objectkg=kglab.KnowledgeGraph()# load RDF from a URLkg.load_rdf("http://bigasterisk.com/foaf.rdf",format="xml")# measure the graphmeasure=kglab.Measure()measure.measure_graph(kg)print("edges:{}\n".format(measure.get_edge_count()))print("nodes:{}\n".format(measure.get_node_count()))# serialize as a string in "Turtle" TTL formatttl=kg.save_rdf_text()print(ttl)See thetutorial notebooksin theexamplessubdirectory for
sample code and patterns to use in integratingkglabwith other
graph libraries in Python:https://derwen.ai/docs/kgl/tutorial/WARNING when installing in an existing environment:Installing a new package in an existing environment may revealor create version conflicts. See thekglabrequirementsinrequirements.txtbefore you do. For example, there areknown version conflictsregarding NumPy (>= 1.19.4) andTensorFlow 2+(~-1.19.2)Using DockerFor a simple approach to running the tutorials, see use ofdocker compose:https://derwen.ai/docs/kgl/tutorial/#use-docker-composeAlso, container images for each release are available on DockerHub:https://hub.docker.com/repository/docker/derwenai/kglabTo build a container image and run it for the tutorials:dockerbuild--pull--rm-f"docker/Dockerfile"-tkglab:latest.
dockerrun-p8888:8888-itkglabTo build and run a container image for testing:dockerbuild--pull--rm-f"docker/testsuite.Dockerfile"-tkglabtest:latest.
dockerrun--rm-itkglabtestBuild InstructionsNote: unless you are contributing code and updates,
in most use cases won't need to build this package locally.Instead, simply install fromPyPior useConda.To set up the build environment locally, see the"Build Instructions"section of the online documentation.Semantic VersioningBeforekglabreaches releasev1.0.0the
types and classes may undergo substantial changes and the project is
not guaranteed to have a consistent API.Even so, we'll try to minimize breaking changes.
We'll also be sure to provide careful notes.See:changelog.txtContributing CodeWe welcome people getting involved as contributors to this open source
project!For detailed instructions please see:CONTRIBUTING.mdLicense and CopyrightSource code forkglabplus its logo, documentation, and examples
have anMIT licensewhich is
succinct and simplifies use in commercial applications.All materials herein are Copyright © 2020-2022 Derwen, Inc.AttributionPlease use the following BibTeX entry for citing **kglab** if you use
it in your research or software.
Citations are helpful for the continued development and maintenance of
this library.@software{kglab,author={Paco Nathan},title={{kglab: a simple abstraction layer in Python for building knowledge graphs}},year=2020,publisher={Derwen},doi={10.5281/zenodo.6360664},url={https://github.com/DerwenAI/kglab}}KudosMany thanks to our open sourcesponsors;
and to our contributors:@ceteri,@dvsrepo,@Ankush-Chander,@louisguitton,@tomaarsen,@Mec-iS,@cutterkom,@RishiKumarRay,@Tpt,@ArenasGuerreroJulian,@fils,@gauravjaglan,@pebbie,@CatChenal,@jake-aft,@dmoore247,
plus general support fromDerwen, Inc.;
theKnowledge Graph ConferenceandConnected Data World;
plus an even larger scope ofuse casesrepresented by their communities;Kubuntu Focus,
theRAPIDS team @ NVIDIA,Gradient Flow,
andManning Publications.Star History