Git Product home page Git Product logo

provo's People

Contributors

christinhenzen avatar rue-a avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

provo's Issues

rethink default values

Currently, many default values are set to None by proxy (e.g., "", [], {}) to be compliant with the given type hint, e.g.

def method(in: str = "", in_2: list = []) -> str:
    <...>
    if <something>:
        return "some string"
    else:
        return ""

instead of:

def method(in: str = None, in_2: list = None) -> str:
    <...>
    if <something>:
        return "some string"
    else:
        return None

According to PyLint some of these default values may be harmful:

dangerous-default-value / W0102

Message emitted:

Dangerous default value %s as argument

Description:

Used when a mutable value as list or dictionary is detected in a default value for an argument.

Problematic code:

def whats\_on\_the\_telly(penguin\=\[\]):  \# \[dangerous-default-value\]
   penguin.append("property of the zoo")
   return penguin

Correct code:

def whats\_on\_the\_telly(penguin\=None):
   if penguin is None:
       penguin \= \[\]
   penguin.append("property of the zoo")
   return penguin

Additional details:

With a mutable default value, with each call the default value is modified, i.e.:

whats\_on\_the\_telly() \# \["property of the zoo"\]
whats\_on\_the\_telly() \# \["property of the zoo", "property of the zoo"\]
whats\_on\_the\_telly() \# \["property of the zoo", "property of the zoo", "property of the zoo"\]

Refactor creation of PROV objects

Currently, you create a PROV object by providing the graph to which it should be added as argument (among other args). Change this, so that the PROV object creation is controlled by class methods of the ProvGraph class.

provGraph = ProvGraph('https://ex.org/')
entity = provGraph.addEntity(id = '...')

instead of

provGraph = ProvGraph('https://ex.org/')
entity = Entity(provGraph, id = '...')

Model

Handle PROV-O graph construction in the ProvGraph class (rather than directly using rdflib functions). Add serialize function that exports the model in different formats.

Add Subclass of ProvenanceOntologyGraph for extended terms

Currently, the ProvGraph Class only know the PROV-O starting terms. This makes sense for simple applications or for users that are new to the PROV DM.

Implement a derived class that also implements the advanced terms of the PROV-DM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.